1 const ytdl = require("ytdl-core")
2 const voice = require("@discordjs/voice")
7 const channel = msg.member.voice.channel
10 return msg.reply("Join a voice channel you fucking moron")
12 const conn = voice.joinVoiceChannel({
13 channelId: channel.id,
14 guildId: channel.guild.id,
15 adapterCreator: channel.guild.voiceAdapterCreator,
18 const stream = ytdl(url.join(" "), {filter: "audioonly"})
19 const resource = voice.createAudioResource(stream, {inputType: voice.StreamType.Arbitrary})
20 const player = voice.createAudioPlayer()
23 conn.subscribe(player)