Skip to content

Commit

Permalink
fix: finding invite data
Browse files Browse the repository at this point in the history
  • Loading branch information
louiszn authored Oct 22, 2024
1 parent 5c3c302 commit a3e5d47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/events/guild/member/GuildMemberAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class GuildMemberAdd extends Listener {
.filter((_, key) => key !== member.guild.id)
.find((previousInvite, key) => {
code = key;
return currentGuildInvites.get(key)!.uses! > previousInvite.uses!;
const uses = currentGuildInvites.get(key)?.uses;
if (uses && previousInvite.uses) {
return uses > previousInvite.uses;
}
});

if (!usedInvite && member.guild.vanityURLCode) {
Expand Down

0 comments on commit a3e5d47

Please sign in to comment.