Added on what the is playing

This commit is contained in:
Andrew Lee 2018-02-23 21:09:52 -05:00
parent 4bfd57f73d
commit 722097790e

20
bot.js
View file

@ -7,6 +7,24 @@ const fs = require('fs');
bot.commands = new Discord.Collection(); bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection(); bot.aliases = new Discord.Collection();
function setGame() {
var games = [
"Pokemon",
"Catching things",
"Finding pokemons",
"Type p: for help"
]
bot.user.setPresence({
status: 'online',
afk: false,
game: {
type: 0,
name: games[Math.floor(Math.random() * games.length)]
}
})
}
fs.readdir('./commands', (err, files) => { fs.readdir('./commands', (err, files) => {
if (err) console.error(err); if (err) console.error(err);
console.log(`Attempting to load a total of ${files.length} commands into the memory.`); console.log(`Attempting to load a total of ${files.length} commands into the memory.`);
@ -31,6 +49,8 @@ fs.readdir('./commands', (err, files) => {
bot.on('ready', () => { bot.on('ready', () => {
console.log('PokeBot has finished loading.'); console.log('PokeBot has finished loading.');
setGame();
bot.setInterval(setGame, 200000);
}); });
bot.on('guildMemberAdd', (member) => { bot.on('guildMemberAdd', (member) => {