Skip to content

Commit

Permalink
[New] More updates to the music commands
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Oct 4, 2021
1 parent f8be8e8 commit 63e36a2
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
42 changes: 40 additions & 2 deletions commands/Music/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,45 @@ const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");

module.exports = {
name: "resume",
args: false,
description: "Resumes a paused song",
aliases: ["r"],
usage: "r || resume",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);

if (!queue || !queue.playing)
return await message.channel.send({
embeds: [
embedMessage("#9dcc37", `❌ | There is nothing playing to resume!`),
],
});

try {
if (queue) {
await queue.setPaused(false);
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`✅ **${
queue.current.title
}** resumed [${message.member.toString()}]`
),
],
});
}
} catch (err) {
client.logger(err.message, "error");
await message.channel.send({
embeds: [embedMessage("#9dcc37", "I was not able to resume this song")],
});
}
},
data: new SlashCommandBuilder()
.setName("resume")
.setDescription("resumes the song"),
.setDescription("Resumes a paused song"),

async execute(interaction, client) {
await interaction.deferReply();
Expand All @@ -24,7 +60,9 @@ module.exports = {
embeds: [
embedMessage(
"#9dcc37",
`✅ **${queue.current.title}** resumed [<@${interaction.user.id}>]`
`✅ **${
queue.current.title
}** resumed [${interaction.member.toString()}]`
),
],
});
Expand Down
35 changes: 33 additions & 2 deletions commands/Music/shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,40 @@ const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");

module.exports = {
name: "shuffle",
args: false,
description: "Shuffles The Music Queue",
usage: "shuffle",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);

if (!queue)
return await message.channel.send({
embeds: [embedMessage("#9dcc37", `❌ | There is no queue to shuffle!`)],
});

try {
if (queue) {
await queue.shuffle();
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`✅ Queue has been shuffled [${message.member.toString()}]`
),
],
});
}
} catch (error) {
client.logger(error.message, "error");
await message.channel.send({
embeds: [embedMessage("#9dcc37", "Could not shuffle the queue")],
});
}
},
data: new SlashCommandBuilder()
.setName("shuffle")
.setDescription("shuffles the music queue"),
.setDescription("Shuffles The Music Queue"),

async execute(interaction, client) {
await interaction.deferReply();
Expand All @@ -22,7 +53,7 @@ module.exports = {
embeds: [
embedMessage(
"#9dcc37",
`✅ Queue has been shuffled [<@${interaction.user.id}>]`
`✅ Queue has been shuffled [${interaction.member.toString()}]`
),
],
});
Expand Down

0 comments on commit 63e36a2

Please sign in to comment.