alright so i am using djs to code a music bot, specifically using djs/voice to help with this. idk if you guys can help me with this, but my bot is not joining nor leaving. (it has joined before but now just... is not..) i can send my code, but the error that shows every time says that the message.guild.id is undefined. ill send it more specifically after this msg
#musicbot help
1 messages · Page 1 of 1 (latest)
any time i say "Sophia join", it used to join, but now displays this : (sorry btw im new)
channelId: message.member.voice.channel.id,
^
TypeError: Cannot read properties of null (reading 'id')
If the member wasn't in a dm, .voice.channel would be null
what do you mean?
Vc sorry
Not dm
let me try again, because when i was in vc it didnt work
If the member was and you're sure
Enable the GUILD_VOICE_STATES Intent
wait nvm
okay you were right sorry about that one, was something small i wanted to bring up, but the real issue is trying to get it to leave.
it joins, but does not leave
client.on('messageCreate', message => {
if(message.content === 'Sophia join'){
joinVoiceChannel({
channelId: message.member.voice.channel.id,
guildId: message.guild.id,
adapterCreator: message.guild.voiceAdapterCreator
})
}
});
client.on('messageCreate', message => {
if (message.content === 'Sophia leave'){
if(!message.guild.me.voice.channel){
return message.reply("I'm not in a voice channel!")
} else {
client.leaveVoiceChannel(message.member.voiceState.channelID);
message.channel.createMessage(`Thanks for tuning in!`);
}
}
});
Client.leaveVoiceChannel?
saw a tut, tried changing that several times
#archive-voice
There, there's a guide pinned
It explains how to disconnect/destroy the connection