blob: a684d9d678f96c1745b791715f0a840eedbd9b3a [file] [log] [blame]
PineaFan0d06edc2023-01-17 22:10:31 +00001import client from "./client.js";
2
3function generalException(location: string) {
4 client.noLog.push(location);
5 setTimeout(() => {
6 client.noLog = client.noLog.filter((i: string) => {
7 return i !== location;
8 });
9 }, 1000);
10}
11
12export function messageException(guild: string, channel: string, message: string) {
13 generalException(`${guild}/${channel}/${message}`);
14}
15
16export function roleException(guild: string, user: string) {
17 generalException(`${guild}/${user}`);
18}
19
20export function preloadPage(target: string, command: string, message: string) {
21 client.preloadPage[target] = {
22 command: command,
23 argument: message
24 }
25 setTimeout(() => {
26 const object = Object.entries(client.preloadPage).filter((entry) => {
27 const [k, _] = entry
28 return k !== target;
29 })
30 client.preloadPage = Object.fromEntries(object);
31 }, 60 * 5 * 1000);
32}