From cd19676edd81612d97008948e4ae1a57fa394e0f Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Jul 2020 16:16:19 -0400 Subject: Help and git; Made ping a public command --- bot.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index fdc6cdc..d88d0d1 100644 --- a/bot.js +++ b/bot.js @@ -52,15 +52,27 @@ client.on('message', async msg => { if (msg.author.bot) return; if (!msg.guild) return; if (!msg.content.startsWith(config.prefix)) return; - if (![config.botOwner].includes(msg.author.id)) return; - let command = msg.content.split(' ')[0]; command = command.slice(config.prefix.length); + // Public allowed commands + + if (command == 'help') { + msg.channel.send(`Bot help:\n\`\`\`${config.prefix}help\n${config.prefix}ping\n${config.prefix}git\n\`\`\``) + } + + if (command == 'git') { + msg.reply("This is the source code of this project.\nhttps://github.com/Alee14/PJ2020-Discord-Bot") + } + if (command == 'ping') { msg.reply('Pong!'); } + if (![config.botOwner].includes(msg.author.id)) return; + + // Bot owner exclusive + if (command == 'stop') { await msg.reply('Powering off...') console.log('Powering off...'); -- cgit v1.2.3