mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix(Guild): remove member's voice state on guildMemberRemove
fixes #2430
This commit is contained in:
@@ -1033,6 +1033,15 @@ class VoiceStateCollection extends Collection {
|
||||
}
|
||||
super.set(id, voiceState);
|
||||
}
|
||||
|
||||
delete(id) {
|
||||
const voiceState = this.get(id);
|
||||
if (voiceState && voiceState.channel_id) {
|
||||
const channel = this.guild.channels.get(voiceState.channel_id);
|
||||
if (channel) channel.members.delete(id);
|
||||
}
|
||||
return super.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Guild;
|
||||
|
||||
Reference in New Issue
Block a user