diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-06 20:50:38 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-06 20:50:38 +0100 |
commit | 54112e2795486dd4c34ae448404bc34b914c8409 (patch) | |
tree | 9ef2541d21dc0a28e5c8955e91821907d93674dc | |
parent | c9e9e2b7649adf592cac68672025b342e04b8e4a (diff) | |
download | furrybot-discord-54112e2795486dd4c34ae448404bc34b914c8409.tar.xz |
Complain about voice channel before resolving url
-rw-r--r-- | music.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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, |