Skip to content

Commit

Permalink
fix: Handle case where inviter may not be found in guild member add e…
Browse files Browse the repository at this point in the history
…vent
  • Loading branch information
MsVoxxie committed Dec 15, 2024
1 parent 9bb4a14 commit c786bce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion events/auditlogs/guildMemberAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = {

// Invite information
const usedInvite = newInvites?.find((invite) => invite.uses > oldInvites.get(invite.code));
const inviter = await client.users?.fetch(usedInvite?.inviter.id);
let inviter = await client.users?.fetch(usedInvite?.inviter.id);
if (!inviter) inviter = { id: null };

// Checks
if (member.id === client.user.id) return;
Expand Down

0 comments on commit c786bce

Please sign in to comment.