From d1fe9177afb762f74dfe20788bcdd137a8d9cc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 6 Sep 2021 19:43:28 +0300 Subject: [PATCH] Updated play.js --- src/client/commands/play.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/client/commands/play.js b/src/client/commands/play.js index 000533e..8bca7e7 100644 --- a/src/client/commands/play.js +++ b/src/client/commands/play.js @@ -30,18 +30,15 @@ module.exports = { let url = query ? query.replace(/<(.+)>/g, "$1") : ""; const radio = client.radio.get(interaction.guild.id); const voiceChannel = interaction.member.voice.channel; - if (!radio) { - if (!voiceChannel) - return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noVoiceChannel, - ephemeral: true - }); - } else { - if (voiceChannel !== radio.voiceChannel) - return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel, - ephemeral: true - }); + if (!voiceChannel) return interaction.reply({ + content: client.messageEmojis["error"] + client.messages.noVoiceChannel, + ephemeral: true + }); + if (radio) { + if (voiceChannel !== radio.voiceChannel) return interaction.reply({ + content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel, + ephemeral: true + }); } if (!query) return interaction.reply({ content: client.messages.noQuery,