This commit is contained in:
ITOH
2021-04-09 21:37:13 +02:00
parent 577010e953
commit 9312606100
26 changed files with 233 additions and 13 deletions
@@ -46,12 +46,20 @@ export async function handleGuildMemberUpdate(data: DiscordGatewayPayload) {
const roleIds = guildMember.roles || [];
roleIds.forEach((id) => {
eventHandlers.debug(
"loop",
`1. Running forEach loop in GUILD_MEMBER_UPDATE file.`,
);
if (!payload.roles.includes(id)) {
eventHandlers.roleLost?.(guild, memberStruct, id);
}
});
payload.roles.forEach((id) => {
eventHandlers.debug(
"loop",
`2. Running forEach loop in GUILD_MEMBER_UPDATE file.`,
);
if (!roleIds.includes(id)) {
eventHandlers.roleGained?.(guild, memberStruct, id);
}