diff --git a/commands/music/clear-queue.js b/commands/music/clear-queue.js index 7693e35..d9dbd37 100644 --- a/commands/music/clear-queue.js +++ b/commands/music/clear-queue.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); client.player.clearQueue(message); diff --git a/commands/music/filter.js b/commands/music/filter.js index 36226f9..d9f00c7 100644 --- a/commands/music/filter.js +++ b/commands/music/filter.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message, args) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); if (!args[0]) return message.channel.send(`${client.emotes.error} - Please specify a valid filter to enable or disable !`); diff --git a/commands/music/loop.js b/commands/music/loop.js index 62b091e..a62e496 100644 --- a/commands/music/loop.js +++ b/commands/music/loop.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); if (client.player.getQueue(message).repeatMode) { diff --git a/commands/music/nowplaying.js b/commands/music/nowplaying.js index 589d887..71c5d20 100644 --- a/commands/music/nowplaying.js +++ b/commands/music/nowplaying.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); const track = client.player.nowPlaying(message); diff --git a/commands/music/pause.js b/commands/music/pause.js index 0214c32..dbfc2d3 100644 --- a/commands/music/pause.js +++ b/commands/music/pause.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); if (client.player.getQueue(message).paused) return message.channel.send(`${client.emotes.error} - The music is already paused !`); diff --git a/commands/music/play.js b/commands/music/play.js index 5672226..30341ce 100644 --- a/commands/music/play.js +++ b/commands/music/play.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message, args) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song !`); client.player.play(message, args.join(" ")); diff --git a/commands/music/queue.js b/commands/music/queue.js index a1acf4a..2381dbd 100644 --- a/commands/music/queue.js +++ b/commands/music/queue.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + const queue = client.player.getQueue(message); if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No songs currently playing !`); diff --git a/commands/music/resume.js b/commands/music/resume.js index a3b687a..548009f 100644 --- a/commands/music/resume.js +++ b/commands/music/resume.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); if (!client.player.getQueue(message).paused) return message.channel.send(`${client.emotes.error} - The music is already playing !`); diff --git a/commands/music/shuffle.js b/commands/music/shuffle.js index 3b8596b..93f3d1c 100644 --- a/commands/music/shuffle.js +++ b/commands/music/shuffle.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); client.player.shuffle(message); diff --git a/commands/music/skip.js b/commands/music/skip.js index a44eca2..d7f4fd3 100644 --- a/commands/music/skip.js +++ b/commands/music/skip.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); client.player.skip(message); diff --git a/commands/music/stop.js b/commands/music/stop.js index b16c450..3e23e00 100644 --- a/commands/music/stop.js +++ b/commands/music/stop.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); client.player.setRepeatMode(message, false); diff --git a/commands/music/volume.js b/commands/music/volume.js index 8a9bdb8..966fc0d 100644 --- a/commands/music/volume.js +++ b/commands/music/volume.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message, args) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); if (!args[0] || isNaN(args[0])) return message.channel.send(`${client.emotes.error} - Please enter a valid number !`); diff --git a/commands/music/w-filters.js b/commands/music/w-filters.js index 0f45e44..20bd798 100644 --- a/commands/music/w-filters.js +++ b/commands/music/w-filters.js @@ -7,6 +7,8 @@ module.exports = { execute(client, message) { if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); + if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`); const disabledEmoji = client.emotes.error;