Reputation: 23
Basically, I want my discord bot to move me to AFK as soon as I deafen but it does nothing with the code I have. I have tried using console.log on the if statement but still nothing.
Code:
client.on("voiceStateUpdate", (oldState, newState) => {
let memchange = newState.member;
if (memchange.selfDeaf) {
memchange.setChannel(afkchannelid);
}
});
Upvotes: 0
Views: 35
Reputation: 109
Did you add the GUILD_VOICE_STATES intent ?
const client = new Client({ intents: ['GUILD_VOICE_STATES'] });
Upvotes: 1