Skip to content

Commit 039cad1

Browse files
committed
simplify expression
1 parent 01f395d commit 039cad1

File tree

1 file changed

+1
-2
lines changed
  • src/commands/modcommands

1 file changed

+1
-2
lines changed

src/commands/modcommands/ban.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ export default class BanCommand implements ApplicationCommand, MessageCommand {
5959
const reason = command.options.getString("reason", true);
6060
const durationHours = command.options.getInteger("hours", false);
6161
const durationMinutes = command.options.getInteger("minutes", false);
62-
const duration =
63-
(durationHours ? durationHours : 0) + (durationMinutes ? durationMinutes / 60 : 0);
62+
const duration = (durationHours ?? 0) + (durationMinutes ? durationMinutes / 60 : 0);
6463

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

0 commit comments

Comments
 (0)