mirror of https://github.com/clickscodes/nucleus
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
950 B
33 lines
950 B
import client from "./client.js";
|
|
|
|
export function generalException(location: string) {
|
|
client.noLog.push(location);
|
|
setTimeout(() => {
|
|
client.noLog = client.noLog.filter((i: string) => {
|
|
return i !== location;
|
|
});
|
|
}, 1000);
|
|
}
|
|
|
|
export function messageException(guild: string, channel: string, message: string) {
|
|
generalException(`${guild}/${channel}/${message}`);
|
|
}
|
|
|
|
export function roleException(guild: string, user: string) {
|
|
generalException(`${guild}/${user}`);
|
|
}
|
|
|
|
export function preloadPage(target: string, command: string, message: string) {
|
|
client.preloadPage[target] = {
|
|
command: command,
|
|
argument: message
|
|
}
|
|
setTimeout(() => {
|
|
const object = Object.entries(client.preloadPage).filter((entry) => {
|
|
const [k, _] = entry
|
|
return k !== target;
|
|
})
|
|
client.preloadPage = Object.fromEntries(object);
|
|
}, 60 * 5 * 1000);
|
|
}
|