Skip to content

Commit

Permalink
Error on ban
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Jan 12, 2024
1 parent 1bf0a32 commit 2635f69
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/discord/events/guildBanAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Colors,
Guild,
GuildAuditLogsEntry,
GuildMember,
PermissionResolvable,
TextChannel,
ThreadChannel,
Expand Down Expand Up @@ -117,7 +118,13 @@ export const guildBanAdd: GuildBanAddEvent = {

if (!guildData) return;

const member = await guild.members.fetch(ban.user.id);
let member = {} as GuildMember;
try {
member = await guild.members.fetch(ban.user.id);
} catch (err:unknown) {
log.debug(F, `Failed to fetch member ${ban.user.id} from guild ${guild.name}`);
return;
}

embed
.setColor(trustScoreColors[trustScoreData.trustScore as keyof typeof trustScoreColors])
Expand Down

0 comments on commit 2635f69

Please sign in to comment.