diff --git a/plugins/console.js b/plugins/console.js index 320dede..8b45e94 100644 --- a/plugins/console.js +++ b/plugins/console.js @@ -57,6 +57,14 @@ function inject(bot, dcclient, config, rl) { if (line.toLowerCase() === '' || line.toLowerCase().startsWith(' ')) return; + if (line.startsWith('.csvr ')) { + const host = line.substring(6); + const bots = bot.getBots(); + bots.forEach((bot) => bot.console.host = host); + bot.console.info(`Host set to: ${host}`); + return; + } + if (bot.options.host !== bot.console.host && bot.console.host !== 'all') return; if (line.toLowerCase() === '.exit' || line.toLowerCase() === '.end') { bot.emit('end', 'end command'); @@ -89,12 +97,6 @@ function inject(bot, dcclient, config, rl) { return; } if (line === '.kill') process.exit(); - if (line.startsWith('.csvr ')) { - const host = line.substring(6); - bot.console.host = host; - bot.console.info(`Host set to: ${host}`); - return; - } if (line.startsWith('.')) { return bot.command_handler.run(