mirror of
https://github.com/tcsenpai/PerplexiBot.git
synced 2025-06-06 19:25:22 +00:00
16 lines
321 B
TypeScript
16 lines
321 B
TypeScript
export default function required(
|
|
condition: any,
|
|
message: string = "Oops! Something went wrong!",
|
|
fatal: boolean = true,
|
|
exitcode: number = -1
|
|
) {
|
|
if (condition) return
|
|
|
|
if (fatal) {
|
|
console.log("[FATAL] " + message);
|
|
process.exit(exitcode);
|
|
} else {
|
|
console.log("[ERROR] " + message);
|
|
}
|
|
}
|