diff options
Diffstat (limited to 'src/util/entities/Invite.ts')
-rw-r--r-- | src/util/entities/Invite.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util/entities/Invite.ts b/src/util/entities/Invite.ts index f7e54fbe..7670a802 100644 --- a/src/util/entities/Invite.ts +++ b/src/util/entities/Invite.ts @@ -99,8 +99,7 @@ export class Invite extends BaseClassWithoutId { static async joinGuild(user_id: string, code: string) { const invite = await Invite.findOneOrFail({ where: { code } }); - if (invite.uses++ >= invite.max_uses && invite.max_uses !== 0) - await Invite.delete({ code }); + if (invite.uses++ >= invite.max_uses && invite.max_uses !== 0) await Invite.delete({ code }); else await invite.save(); await Member.addToGuild(user_id, invite.guild_id); |