@@ -367,7 +367,7 @@ function connectToDiscord() {
367367initPluginLoader ( ) ;
368368
369369// Load commandline args as env variables
370- commander . version ( "1.0.1 " ) . usage ( "[options]" )
370+ commander . version ( "1.0.2 " ) . usage ( "[options]" )
371371. option ( "-e, --email <Picarto Channel>" , "Set the bots Login Username." )
372372. option ( "-p, --password <Bot name>" , "Set the bot's Login Password." )
373373. option ( "-t, --token <Token>" , "Use an already existing token to login." )
@@ -568,23 +568,34 @@ function plugin_cmd(args) {
568568 var plugin_info ; var plugin_state ; var plugin ;
569569 var list = plugin_loader . listPlugins ( ) ;
570570 for ( var plugin_index in list ) {
571- plugin = list [ plugin_index ] ;
572- plugin_info = plugin_loader . getPluginInfo ( plugin ) ;
573- if ( plugin_loader . isPluginRunning ( plugin ) ) {
574- plugin_state = "Running" ;
575- } else if ( plugin_loader . isPluginLoaded ( plugin ) ) {
576- plugin_state = "Stopped" ;
577- } else {
578- plugin_state = "Unloaded"
571+ try {
572+ plugin = list [ plugin_index ] ;
573+ plugin_info = plugin_loader . getPluginInfo ( plugin ) ;
574+ if ( plugin_loader . isPluginRunning ( plugin ) ) {
575+ plugin_state = "Running" ;
576+ } else if ( plugin_loader . isPluginLoaded ( plugin ) ) {
577+ plugin_state = "Stopped" ;
578+ } else {
579+ plugin_state = "Unloaded"
580+ }
581+ data . push ( {
582+ plugin_name : plugin_info . Name ,
583+ plugin_version : plugin_info . Version ,
584+ plugin_author : plugin_info . Author ,
585+ plugin_description : plugin_info . Description ,
586+ plugin_state : plugin_state ,
587+ plugin_file : plugin . replace ( / \. d b o t \. j s / , "" ) ,
588+ } ) ;
589+ } catch ( ex ) {
590+ data . push ( {
591+ plugin_name : "ERROR" ,
592+ plugin_version : "ERROR" ,
593+ plugin_author : "ERROR" ,
594+ plugin_description : ex ,
595+ plugin_state : "errored" ,
596+ plugin_file : plugin . replace ( / \. d b o t \. j s / , "" ) ,
597+ } ) ;
579598 }
580- data . push ( {
581- plugin_name : plugin_info . Name ,
582- plugin_version : plugin_info . Version ,
583- plugin_author : plugin_info . Author ,
584- plugin_description : plugin_info . Description ,
585- plugin_state : plugin_state ,
586- plugin_file : plugin . replace ( / \. p b o t \. j s / , "" ) ,
587- } ) ;
588599 data . push ( column_divider ) ;
589600 }
590601 console . log (
0 commit comments