We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fd4896 commit db031dcCopy full SHA for db031dc
1 file changed
src/service/ban.ts
@@ -5,6 +5,7 @@ import { Temporal } from "@js-temporal/polyfill";
5
import type { BotContext } from "#context.ts";
6
import * as ban from "#storage/ban.ts";
7
import { formatDuration } from "#utils/dateUtils.ts";
8
+import * as timeUtils from "#utils/time.ts";
9
10
import log from "#log";
11
@@ -84,7 +85,7 @@ export async function banUser(
84
85
const unbanAt =
86
durationInHours === null
87
? null // infinite ban
- : new Date(Date.now() + durationInHours * 60 * 60 * 1000);
88
+ : new Date(Date.now() + timeUtils.hours(durationInHours));
89
90
await ban.persistOrUpdate(member, unbanAt?.toTemporalInstant() ?? null, isSelfBan, reason);
91
0 commit comments