set undefined

this.client.voice.adapters.set(this.id, methods); ^ TypeError: Cannot read properties of undefined (reading 'set') at Object.adapterCreator (/home/container/node_modules/discord.js/src/structures/Guild.js:1415:34) at new VoiceConnection (/home/container/node_modules/@discordjs/voice/dist/index.js:1683:29) at createVoiceConnection (/home/container/node_modules/@discordjs/voice/dist/index.js:2103:27) at joinVoiceChannel (/home/container/node_modules/@discordjs/voice/dist/index.js:2124:10) at Client.<anonymous> (/home/container/index.js:36:20) at Client.emit (node:events:530:35) at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:388:17) at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:371:10) at WebSocketShard.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:201:16) at WebSocketShard.emit (node:events:518:28) at WebSocketShard.checkReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:181:12) at WebSocketShard.gotGuild (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:155:10) at WebSocketManager.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:241:15) at WebSocketManager.emit (/home/container/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31) at WebSocketShard.<anonymous> (/home/container/node_modules/@discordjs/ws/dist/index.js:1173:51) at WebSocketShard.emit (/home/container/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
6 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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 staff
ALB_Osman
ALB_OsmanOP11mo ago
code
client.on("ready",() => {
console.log(`${client.user.username} olarak giriş yaptı`)
const { joinVoiceChannel } = require('@discordjs/voice');

const connection = joinVoiceChannel({
channelId: "987438227843579924",
guildId: "475698665181413377",
adapterCreator: client.guilds.cache.get("475698665181413377").voiceAdapterCreator,
});

})
client.on("ready",() => {
console.log(`${client.user.username} olarak giriş yaptı`)
const { joinVoiceChannel } = require('@discordjs/voice');

const connection = joinVoiceChannel({
channelId: "987438227843579924",
guildId: "475698665181413377",
adapterCreator: client.guilds.cache.get("475698665181413377").voiceAdapterCreator,
});

})
versions "discord.js": "^14.14.1", "@discordjs/voice":"0.16.0",
duck
duck11mo ago
that's definitely an interesting error <Client>.voice.adapters should always exist, so either you're overriding existing properties on djs structures or something is incredibly wrong with your local installation of djs to address the latter, a fresh install of deps may help but for the former, you should ensure you aren't overriding <Client>.voice anywhere
ALB_Osman
ALB_OsmanOP11mo ago
thanks i am using client.voice i changed
duck
duck11mo ago
in future please remember to check the docs before setting custom properties
ALB_Osman
ALB_OsmanOP11mo ago
okey I was making a car riddle bot from car sounds, I recorded the sounds that way.

Did you find this page helpful?