mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-17 03:38:17 +00:00
fix: remove role from coll after the event (#304)
* fix: remove role from coll after the event * fix: check if cachedRole is not nil Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -27,8 +27,9 @@ export async function handleInternalGuildRoleDelete(data: DiscordPayload) {
|
||||
if (!guild) return;
|
||||
|
||||
const cachedRole = guild.roles.get(payload.role_id)!;
|
||||
if (cachedRole) eventHandlers.roleDelete?.(guild, cachedRole);
|
||||
|
||||
guild.roles.delete(payload.role_id);
|
||||
eventHandlers.roleDelete?.(guild, cachedRole);
|
||||
|
||||
// For bots without GUILD_MEMBERS member.roles is never updated breaking permissions checking.
|
||||
cacheHandlers.forEach("members", (member) => {
|
||||
|
||||
Reference in New Issue
Block a user