From cb92c254dca226acab2676aa2807bb3e0817f40a Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 6 Mar 2022 18:29:21 +0100 Subject: [PATCH] Style --- music.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/music.js b/music.js index 745c549..c182a5e 100644 --- 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) } } -- 2.44.0