Bot don't join VC (err: TypeError: Cannot read properties of undefined (reading 'set') )

When i try to do this
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
it returns me the error
TypeError: Cannot read properties of undefined (reading 'set')
at Object.adapterCreator (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\discord.js\src\structures\Guild.js:1418:34)
at new VoiceConnection (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:1699:29)
at createVoiceConnection (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:2118:27)
at joinVoiceChannel (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:2139:10)
at client.connectToChannel (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\src\handlers\audio\radio.js:34:32)
System >> [Sun Nov 17 2024 10:59:16] >> Starting up ...
TypeError: Cannot read properties of undefined (reading 'set')
at Object.adapterCreator (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\discord.js\src\structures\Guild.js:1418:34)
at new VoiceConnection (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:1699:29)
at createVoiceConnection (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:2118:27)
at joinVoiceChannel (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\node_modules\@discordjs\voice\dist\index.js:2139:10)
at client.connectToChannel (C:\Users\schad\OneDrive\discord bot\spooky_v14_2\src\handlers\audio\radio.js:34:32)
System >> [Sun Nov 17 2024 10:59:16] >> Starting up ...
And when i log channel.guild.voiceAdapterCreator I recieve this in the console Voice Adapter Creator: [Function (anonymous)] Someone who can help me with this?
2 Replies
d.js toolkit
d.js toolkit3w ago
- What are your intents? GuildVoiceStates is required to receive voice data! - Show what dependencies you are using -- generateDependencyReport() is exported from @discordjs/voice. - Try looking at common examples: https://github.com/discordjs/voice-examples. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Rubenツ
RubenツOP3w ago
I have searched my intire code but i didn't find any changes i made in the code. I also didn't create any Client.voice or something like that because i'm always referencing to the package It gives me this
[AsyncFunction (anonymous)] {
same: [AsyncFunction (anonymous)],
in: [AsyncFunction (anonymous)],
bot: [AsyncFunction (anonymous)]
}
[AsyncFunction (anonymous)] {
same: [AsyncFunction (anonymous)],
in: [AsyncFunction (anonymous)],
bot: [AsyncFunction (anonymous)]
}
looks like i over write it. Now it's fixed. Thanks
Want results from more Discord servers?
Add your server