Skip to content

Commit

Permalink
simplify expression
Browse files Browse the repository at this point in the history
  • Loading branch information
twobiers committed Jan 23, 2025
1 parent 01f395d commit 039cad1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commands/modcommands/ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ export default class BanCommand implements ApplicationCommand, MessageCommand {
const reason = command.options.getString("reason", true);
const durationHours = command.options.getInteger("hours", false);
const durationMinutes = command.options.getInteger("minutes", false);
const duration =
(durationHours ? durationHours : 0) + (durationMinutes ? durationMinutes / 60 : 0);
const duration = (durationHours ?? 0) + (durationMinutes ? durationMinutes / 60 : 0);

const userAsGuildMember = command.guild?.members.resolve(user);
if (!userAsGuildMember) {
Expand Down

0 comments on commit 039cad1

Please sign in to comment.