blob: e8a807307f486d76a867b4918dd72ccdbb5e5a9c [file] [log] [blame]
PineaFan0d06edc2023-01-17 22:10:31 +00001import client from "./client.js";
2
Samuel Shuert27bf3cd2023-03-03 15:51:25 -05003export function generalException(location: string) {
PineaFan0d06edc2023-01-17 22:10:31 +00004 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);
Samuel Shuert27bf3cd2023-03-03 15:51:25 -050032}