storage
This commit is contained in:
@@ -144,4 +144,46 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
},
|
||||
'summon': {
|
||||
desc: `Summon a bot online indefinitely`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242'],
|
||||
ignoreLock: true,
|
||||
async function(from, botName){
|
||||
if(botName in this.constructor.bots){
|
||||
let bot = this.constructor.bots[botName];
|
||||
|
||||
if (!bot.isReady){
|
||||
try{
|
||||
await bot.connect();
|
||||
this.whisper(from, `${botName} is now online`);
|
||||
}catch(error){
|
||||
this.whisper(from, `Failed to summon ${botName}. Try again later.`);
|
||||
}
|
||||
} else {
|
||||
this.whisper(from, `${botName} is already online`);
|
||||
}
|
||||
} else {
|
||||
this.whisper(from, `Unknown bot: ${botName}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
'dismiss': {
|
||||
desc: `Send a bot offline`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242'],
|
||||
ignoreLock: true,
|
||||
async function(from, botName){
|
||||
if(botName in this.constructor.bots){
|
||||
let bot = this.constructor.bots[botName];
|
||||
|
||||
if(bot.isReady){
|
||||
bot.quit();
|
||||
this.whisper(from, `${botName} is now offline`);
|
||||
} else {
|
||||
this.whisper(from, `${botName} is already offline`);
|
||||
}
|
||||
} else {
|
||||
this.whisper(from, `Unknown bot: ${botName}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user