diff options
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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); |
