]> git.lizzy.rs Git - furrybot-discord.git/commitdiff
Style
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 6 Mar 2022 17:29:21 +0000 (18:29 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 6 Mar 2022 17:29:21 +0000 (18:29 +0100)
music.js

index 745c5491033c251f40a2aa5669f6ae0703e14c04..c182a5e996032a00982cf5f033b4740488b7fdd7 100644 (file)
--- a/music.js
+++ b/music.js
@@ -5,7 +5,7 @@ module.exports = {
        play: {
                func: (msg, url) => {
                        const channel = msg.member.voice.channel
-                       
+
                        if (! channel)
                                return msg.reply("Join a voice channel you fucking moron")
 
@@ -14,12 +14,9 @@ module.exports = {
                                guildId: channel.guild.id,
                                adapterCreator: channel.guild.voiceAdapterCreator,
                        })
-               
-                       const stream = ytdl(url.join(" "), {filter: "audioonly"})
-                       const resource = voice.createAudioResource(stream, {inputType: voice.StreamType.Arbitrary})
                        const player = voice.createAudioPlayer()
-                               
-                       player.play(resource)
+
+                       player.play(voice.createAudioResource(ytdl(url.join(" "), {filter: "audioonly"}), {inputType: voice.StreamType.Arbitrary}))
                        conn.subscribe(player)
                }
        }