aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/bot.js b/bot.js
index cf97232..7657c30 100644
--- a/bot.js
+++ b/bot.js
@@ -2,4 +2,30 @@ const Discord = require('discord.js');
const bot = new Discord.Client();
const config = require('./config.json');
+bot.on('ready', () => {
+ console.log('PokeBot has finished loading.');
+});
+
+bot.on('message', (msg) => {
+ parseCommand(msg);
+});
+
+function parseCommand(msg) {
+ if (msg.author.bot) return;
+ if (!msg.content.startsWith('p:')) return;
+
+ const args = msg.content.slice(2).split(' ');
+ const command = args.shift();
+
+ switch (command)
+ {
+ case 'help':
+ msg.channel.send(
+ new Discord.RichEmbed()
+ .setColor (0x00ae86)
+ .addField('Getting Started |', '**p:help** | Displays this help message')
+ );
+ break;
+ }
+}
bot.login(config.token);