diff --git a/commands/playAudio.js b/commands/playAudio.js index b0d1b89..52421e8 100644 --- a/commands/playAudio.js +++ b/commands/playAudio.js @@ -31,9 +31,12 @@ module.exports = { https://github.com/porridgewithraisins/jam-bot#known-bugs) const stream = await ytdl(url, { filter: 'audioonly' }); */ - // const channel = bot.channels.cache.get("930148609406685227"); - const channel = message.member.guild.voice.channel; - if (!channel) { message.reply("Please join a voice channel before you try this!"); } + + if (!message.member.voice.channel) { + message.reply("Please join a voice channel before you try this!"); + return; + } + const channel = bot.channels.cache.get(message.member.voice.channel.id); const connection = joinVoiceChannel({ channelId: channel.id, diff --git a/main.js b/main.js index 1b9174c..d1183f9 100644 --- a/main.js +++ b/main.js @@ -105,4 +105,4 @@ bot.on('messageCreate', (message) => { //Last Line -bot.login(process.env.token); \ No newline at end of file +bot.login("OTQ0MDQ2OTAyNDE1MDkzNzYw.Yg76MQ.A4V6Tqvrhuvq8nCafABCBrx8uuM"); \ No newline at end of file