mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix(Guild): memberCount not decrementing when an uncached member leaves
This leads to GuildMemberStore#_fetchMany to always reject because it expects more member than possible. Also no longer call the GuildMemberRemove handler locally to not decrement twice.
This commit is contained in:
@@ -526,12 +526,7 @@ class GuildMember extends Base {
|
||||
*/
|
||||
kick(reason) {
|
||||
return this.client.api.guilds(this.guild.id).members(this.user.id).delete({ reason })
|
||||
.then(() =>
|
||||
this.client.actions.GuildMemberRemove.handle({
|
||||
guild_id: this.guild.id,
|
||||
user: this.user,
|
||||
}).member
|
||||
);
|
||||
.then(() => this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user