Skip to content

Commit

Permalink
Add loop button to reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
eritislami committed Apr 1, 2020
1 parent cba3dd6 commit f29b61a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/play.js
Expand Up @@ -53,6 +53,7 @@ module.exports = {
await playingMessage.react("⏭");
await playingMessage.react("⏸");
await playingMessage.react("▶");
await playingMessage.react("🔁");
await playingMessage.react("⏹");
} catch (error) {
console.error(error);
Expand All @@ -78,13 +79,23 @@ module.exports = {
queue.playing = false;
queue.connection.dispatcher.pause();
queue.textChannel.send(`${user} ⏸ paused the music.`).catch(console.error);
reaction.users.remove(user);
break;

case "▶":
if (queue.playing) break;
queue.playing = true;
queue.connection.dispatcher.resume();
queue.textChannel.send(`${user} ▶ resumed the music!`).catch(console.error);
reaction.users.remove(user);
break;

case "🔁":
queue.loop = !queue.loop;
queue.textChannel
.send(`Loop is now ${queue.loop ? "**on**" : "**off**"}`)
.catch(console.error);
reaction.users.remove(user);
break;

case "⏹":
Expand Down

0 comments on commit f29b61a

Please sign in to comment.