diff --git a/src/events/guild/member/GuildMemberAdd.ts b/src/events/guild/member/GuildMemberAdd.ts index 0846900..6dff54e 100644 --- a/src/events/guild/member/GuildMemberAdd.ts +++ b/src/events/guild/member/GuildMemberAdd.ts @@ -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) {