Skip to content

Commit db031dc

Browse files
committed
Use utils where applicable
1 parent 9fd4896 commit db031dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/service/ban.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Temporal } from "@js-temporal/polyfill";
55
import type { BotContext } from "#context.ts";
66
import * as ban from "#storage/ban.ts";
77
import { formatDuration } from "#utils/dateUtils.ts";
8+
import * as timeUtils from "#utils/time.ts";
89

910
import log from "#log";
1011

@@ -84,7 +85,7 @@ export async function banUser(
8485
const unbanAt =
8586
durationInHours === null
8687
? null // infinite ban
87-
: new Date(Date.now() + durationInHours * 60 * 60 * 1000);
88+
: new Date(Date.now() + timeUtils.hours(durationInHours));
8889

8990
await ban.persistOrUpdate(member, unbanAt?.toTemporalInstant() ?? null, isSelfBan, reason);
9091

0 commit comments

Comments
 (0)