PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 1 | import client from "./client.js"; |
| 2 | |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -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 |
| 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 Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame^] | 32 | } |