]> git.lizzy.rs Git - furrybot-discord.git/blobdiff - music.js
Add bad apple
[furrybot-discord.git] / music.js
index 50bba47eb30c53f75e28e27e8786fb5b218edab4..b4366251765105e0880e7fa7f3d289f5f23c00bc 100644 (file)
--- a/music.js
+++ b/music.js
@@ -5,19 +5,20 @@ 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 {
                                new URL(url)
                        } catch {
                                url = "https://youtube.com/watch?v=" + (await youtubeSearchApi.GetListByKeyword(url, false, 1)).items[0].id
+                               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,