diff options
| author | Alee14 <Alee14498@gmail.com> | 2018-01-12 19:06:32 -0500 |
|---|---|---|
| committer | Alee14 <Alee14498@gmail.com> | 2018-01-12 19:06:32 -0500 |
| commit | 0bd7dac470c21a3aeea6b31c3644459f2c528527 (patch) | |
| tree | f6f4545c952c4a08a4a591d0cd80bd26a0195a34 /bot.js | |
| parent | a9220483be2486fd6559f3456e625f02463087d2 (diff) | |
| download | VTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.tar.gz VTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.tar.bz2 VTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.zip | |
Added help and ping command + added setgame
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +const Discord = require("discord.js"); +const client = new Discord.Client(); +const config = require('./config.json'); +const vtVersion = "1.0.0"; +const prefix = "vt!"; + +function setGame() { + var games = [ + "For help: vt!help", + "QT Creator", + "theShell", + "VS Code" + ] + + client.user.setPresence({ + status: 'online', + afk: false, + game: { + type: 0, + name: games[Math.floor(Math.random() * games.length)] + } + }) +} + +client.on('ready', () => { + console.log(`[STATUS] Bot is now ready!`); + console.log(`[STATUS] Logged in as ${client.user.tag}!`); + setGame(); + client.setInterval(setGame, 200000); +}); + +client.on('message', msg => { + + if (msg.content == prefix + 'help') { + const embed = new Discord.RichEmbed(); + embed.setTitle('VTBot Help') + embed.setDescription('Every command you put in this bot must start with `' + prefix + '`') + embed.addField('- General Commands', 'ping', true) + .setFooter("VTBot Copyright 2018. The version that VTBot's running is " + vtVersion + "!") + embed.setColor("00C8FF") + msg.channel.send({embed}); + } + + if (msg.content == prefix + 'ping') { + msg.reply(':warning: Pong!') + } + + +}); + +client.login(config.token);
\ No newline at end of file |
