Skip to content

Commit

Permalink
[Fix] fixed repeat command showing no music is playing error messag…
Browse files Browse the repository at this point in the history
…e first
  • Loading branch information
naseif committed Nov 15, 2021
1 parent 38283e9 commit fc64be3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions commands/Music/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ module.exports = {
const queue = client.player.getQueue(message.guild);
const mode = args.join(" ");

if (
message.guild.me.voice.channelId &&
message.member.voice.channelId !== message.guild.me.voice.channelId
)
return await message.channel.send({
embeds: [
embedMessage(
"RED",
`❌ | You must be in my voice channel to activate the loop mode!`
),
],
});

if (!queue || !queue.playing) {
return await message.channel.send({
embeds: [embedMessage("RED", `❌ | No music is being played!`)],
Expand All @@ -35,19 +48,6 @@ module.exports = {
});
}

if (
message.guild.me.voice.channelId &&
message.member.voice.channelId !== message.guild.me.voice.channelId
)
return await message.channel.send({
embeds: [
embedMessage(
"RED",
`❌ | You must be in my voice channel to activate the loop mode!`
),
],
});

switch (mode) {
case "off":
await queue.setRepeatMode(Number(0));
Expand Down

0 comments on commit fc64be3

Please sign in to comment.