From 6b5aba8d91870d169627e0e960965aad568aa3ab Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 22 Jul 2020 20:19:45 -0400 Subject: Added resume and pause command --- bot.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index 366d8a2..c0a8526 100644 --- a/bot.js +++ b/bot.js @@ -93,7 +93,7 @@ client.on('message', async msg => { // Public allowed commands if (command == 'help') { - if (!msg.guild.member(client.user).hasPermission('EMBED_LINKS')) return msg.reply('ERROR: This bot doesn\'t have the permission to send embed links please enable them to use the full help.'); + if (!msg.guild.member(client.user).hasPermission('EMBED_LINKS')) return msg.reply('**ERROR: This bot doesn\'t have the permission to send embed links please enable them to use the full help.**'); const helpEmbed = new Discord.MessageEmbed() .setAuthor(`${client.user.username} Help`) .setDescription(`Currently playing \`${audio}\`.`) @@ -115,7 +115,6 @@ client.on('message', async msg => { if (command == 'playing') { msg.channel.send('Currently playing `' + audio + '`.'); } - if (command == 'about') { msg.channel.send('The bot code was created by Andrew Lee (Alee#4277). Written in Discord.JS and licensed with GPL-3.0.'); @@ -131,6 +130,16 @@ client.on('message', async msg => { playAudio(); } + if (command == 'resume') { + msg.reply('Resuming music.'); + dispatcher.resume(); + } + + if (command == 'pause') { + msg.reply('Pausing music.'); + dispatcher.pause(); + } + if (command == 'skip') { msg.reply('Skipping `' + audio + '`...'); dispatcher.pause(); @@ -150,6 +159,7 @@ client.on('message', async msg => { if (command == 'stop') { await msg.reply('Powering off...'); console.log('Powering off...'); + dispatcher.destroy(); client.destroy(); process.exit(0); } -- cgit v1.2.3