aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-07-22 20:19:45 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-07-22 20:19:45 -0400
commit6b5aba8d91870d169627e0e960965aad568aa3ab (patch)
tree089530f405d5ce6fd8787043d9c22c63fdeb3239
parent8b08e5cf61c84c1a1490f13ad6124619c5d48db4 (diff)
downloadDLAP-6b5aba8d91870d169627e0e960965aad568aa3ab.tar.gz
DLAP-6b5aba8d91870d169627e0e960965aad568aa3ab.tar.bz2
DLAP-6b5aba8d91870d169627e0e960965aad568aa3ab.zip
Added resume and pause command
-rw-r--r--README.md2
-rw-r--r--bot.js14
2 files changed, 14 insertions, 2 deletions
diff --git a/README.md b/README.md
index 065d061..4c07afe 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,8 @@ about - About the bot.
Bot Owner Only
--------------
join - Joins voice chat.
+resume - Resumes music.
+pause - Pauses music.
skip - Skips the audio track.
leave - Leaves voice chat.
stop - Stops bot.
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);
}