aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.js16
1 files 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...');