blob: af416726d6ddc92fa1defee7de0e26a0ca233913 [file] [log] [blame]
PineaFan0d06edc2023-01-17 22:10:31 +00001import client from "./client.js";
2
TheCodedProf1807fb32023-02-20 14:33:48 -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
Skyler Greyda16adf2023-03-05 10:22:12 +000024 };
PineaFan0d06edc2023-01-17 22:10:31 +000025 setTimeout(() => {
26 const object = Object.entries(client.preloadPage).filter((entry) => {
Skyler Greyda16adf2023-03-05 10:22:12 +000027 const [k, _] = entry;
PineaFan0d06edc2023-01-17 22:10:31 +000028 return k !== target;
Skyler Greyda16adf2023-03-05 10:22:12 +000029 });
PineaFan0d06edc2023-01-17 22:10:31 +000030 client.preloadPage = Object.fromEntries(object);
31 }, 60 * 5 * 1000);
TheCodedProf1807fb32023-02-20 14:33:48 -050032}