add logon command

This commit is contained in:
2023-10-12 17:12:18 -04:00
parent 39590ffefa
commit e4f0f6db88
2 changed files with 120 additions and 95 deletions

View File

@ -15,11 +15,36 @@ module.exports = {
},
'say': {
desc: `Make the bot say stuff in chat`,
allowed: ['wmantly', 'useless666', 'tux4242'],
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
ignoreLock: true,
async function(from, ...messages){
await this.say((messages || []).join(' '));
}
}
},
'logon': {
desc: `Have bot log on for 10 seconds'`,
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
ignoreLock: true,
async function(from, botName){
this.__unLockCommand();
if(botName in his.constructor.bots){
let bot = this.constructor.bots[botName];
if(!bot.isReady){
try{
await bot.connect();
var clear = setTimeout(()=> bot.quit(), 10000);
bot.whisper(from, 'I am ready')
}catch(error){
console.log('inv error connecting to bot');
this.whisper('Bot is not available right now, try again in 30 seconds.');
}
}else{
await this.whisper(from, `Bot ${bot.bot.entity.username} Already online`);
}
}
}
},
};