mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -05:00
fix csvr
This commit is contained in:
parent
aef414fd3b
commit
01de4103f0
1 changed files with 8 additions and 6 deletions
|
@ -57,6 +57,14 @@ function inject(bot, dcclient, config, rl) {
|
||||||
if (line.toLowerCase() === '' ||
|
if (line.toLowerCase() === '' ||
|
||||||
line.toLowerCase().startsWith(' ')) return;
|
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 (bot.options.host !== bot.console.host && bot.console.host !== 'all') return;
|
||||||
if (line.toLowerCase() === '.exit' || line.toLowerCase() === '.end') {
|
if (line.toLowerCase() === '.exit' || line.toLowerCase() === '.end') {
|
||||||
bot.emit('end', 'end command');
|
bot.emit('end', 'end command');
|
||||||
|
@ -89,12 +97,6 @@ function inject(bot, dcclient, config, rl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (line === '.kill') process.exit();
|
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('.')) {
|
if (line.startsWith('.')) {
|
||||||
return bot.command_handler.run(
|
return bot.command_handler.run(
|
||||||
|
|
Loading…
Reference in a new issue