aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--music.js10
1 files changed, 5 insertions, 5 deletions
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,