Get stuff a user did in the last (16) hours

This commit is contained in:
zkldi
2021-11-22 11:44:27 +00:00
parent 028b31a54d
commit 428764a1f3
5 changed files with 99 additions and 15 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
import crypto from "crypto";
import { ONE_HOUR } from "lib/constants/time";
import { TachiConfig } from "lib/setup/config";
import { Game, GamePTConfig, GetGameConfig, Playtypes } from "tachi-common";
import { Game, GamePTConfig, GetGameConfig, Playtypes, integer } from "tachi-common";
// https://github.com/sindresorhus/escape-string-regexp/blob/main/index.js
// the developer of this has migrated everything to Force ES6 style modules,
@@ -128,3 +129,7 @@ export function IsValidURL(string: string) {
export function Sleep(ms: number) {
return new Promise<void>((resolve) => setTimeout(() => resolve(), ms));
}
export function GetTimeXHoursAgo(hours: integer) {
return Date.now() - ONE_HOUR * hours;
}