Skip to content

Commit

Permalink
fix: protection.expries is mistakenly set
Browse files Browse the repository at this point in the history
  • Loading branch information
vittee committed Nov 15, 2024
1 parent c3efc93 commit 173731b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command/commands/protect/protection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function addProtection(client: Client, guildId: Guild['id'], userId: User
const result = {
guildId,
userId,
expires: clamp(Math.max(expires, protection?.expires ?? 0), 0, maxCredits ?? 10),
credits: (protection?.credits ?? 0) + 1
expires: Math.max(expires, protection?.expires ?? 0),
credits: clamp((protection?.credits ?? 0) + 1, 0, maxCredits ?? 10)
}

protections.set(key, result);
Expand Down

0 comments on commit 173731b

Please sign in to comment.