PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 1 | import client from "./client.js"; |
| 2 | |
TheCodedProf | 1807fb3 | 2023-02-20 14:33:48 -0500 | [diff] [blame] | 3 | export function generalException(location: string) { |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 4 | client.noLog.push(location); |
| 5 | setTimeout(() => { |
| 6 | client.noLog = client.noLog.filter((i: string) => { |
| 7 | return i !== location; |
| 8 | }); |
| 9 | }, 1000); |
| 10 | } |
| 11 | |
| 12 | export function messageException(guild: string, channel: string, message: string) { |
| 13 | generalException(`${guild}/${channel}/${message}`); |
| 14 | } |
| 15 | |
| 16 | export function roleException(guild: string, user: string) { |
| 17 | generalException(`${guild}/${user}`); |
| 18 | } |
| 19 | |
| 20 | export function preloadPage(target: string, command: string, message: string) { |
| 21 | client.preloadPage[target] = { |
| 22 | command: command, |
| 23 | argument: message |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 24 | }; |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 25 | setTimeout(() => { |
| 26 | const object = Object.entries(client.preloadPage).filter((entry) => { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 27 | const [k, _] = entry; |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 28 | return k !== target; |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 29 | }); |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 30 | client.preloadPage = Object.fromEntries(object); |
| 31 | }, 60 * 5 * 1000); |
TheCodedProf | 1807fb3 | 2023-02-20 14:33:48 -0500 | [diff] [blame] | 32 | } |