guildMemberUpdate only firing on 2nd event

So I have subscribed to the guildMemberUpdate event, but it is not being called the first time I assign a role to someone. Only when I remove that role is it firing. From then after it works perfectly.
DiscordClient.on("guildMemberUpdate", async (oldMember: GuildMember, newMember: GuildMember) => {
console.log("Firing...");
});
DiscordClient.on("guildMemberUpdate", async (oldMember: GuildMember, newMember: GuildMember) => {
console.log("Firing...");
});
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
nullopt
nullopt2y ago
As you can see from the gif, I remove the role, but the event isn't called Only after re-adding it, it gets called (after this, everything is fine)
Syjalo
Syjalo2y ago
Because the first time the member isn't cached. You need GuildMemebr partial.
d.js docs
d.js docs2y ago
guide Popular Topics: Partial Structures read more