From bcdde81872db6a702c0b34b73bb507b8fcd104aa Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 23 Jul 2020 13:10:06 -0400 Subject: Re-added setPresence --- bot.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index e368b83..57cdfb2 100644 --- a/bot.js +++ b/bot.js @@ -49,6 +49,7 @@ function playAudio() { console.log('Now playing ' + audio); const statusEmbed = new Discord.MessageEmbed() + .setAuthor(`${bot.user.username}`, bot.user.avatarURL()) .addField('Now Playing', `${audio}`) .setColor('#0066ff') @@ -78,15 +79,23 @@ bot.on('ready', () => { console.log(`Voice Channel: ${config.voiceChannel}`); console.log(`Status Channel: ${config.statusChannel}\n`); + bot.user.setPresence({ + activity: { + name: `Music | ${config.prefix}help` + }, + status: 'online', + afk: false, + }).then(console.log) + .catch(console.error); + const readyEmbed = new Discord.MessageEmbed() - .setTitle(bot.user.username) + .setAuthor(`${bot.user.username}`, bot.user.avatarURL()) .setDescription('Starting bot...') .setColor('#0066ff') let statusChannel = bot.channels.cache.get(config.statusChannel); if (!statusChannel) return console.error('The status channel does not exist! Skipping.'); statusChannel.send(readyEmbed); - bot.user.setStatus('online'); console.log('Connected to the voice channel.'); playAudio(); }); @@ -167,7 +176,7 @@ bot.on('message', async msg => { if (command == 'stop') { await msg.reply('Powering off...'); const statusEmbed = new Discord.MessageEmbed() - .setTitle(bot.user.username) + .setAuthor(`${bot.user.username}`, bot.user.avatarURL()) .setDescription(`That\'s all folks! Powering down ${bot.user.username}...`) .setColor('#0066ff') let statusChannel = bot.channels.cache.get(config.statusChannel); -- cgit v1.2.3