From: Elias Fleckenstein Date: Sun, 6 Mar 2022 19:50:38 +0000 (+0100) Subject: Complain about voice channel before resolving url X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=54112e2795486dd4c34ae448404bc34b914c8409;p=furrybot-discord.git Complain about voice channel before resolving url --- diff --git a/music.js b/music.js index 95821e9..b436625 100644 --- a/music.js +++ b/music.js @@ -5,6 +5,11 @@ const youtubeSearchApi = require("youtube-search-api") module.exports = { play: { func: async (msg, urlArr) => { + const channel = msg.member.voice.channel + + if (! channel) + return msg.reply("Join a voice channel you fucking moron") + let url = urlArr.join(" ") try { @@ -14,11 +19,6 @@ module.exports = { msg.reply("Playing this: " + url) } - const channel = msg.member.voice.channel - - if (! channel) - return msg.reply("Join a voice channel you fucking moron") - const conn = voice.joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id,