1 |
|
import { exec } from "child_process"; |
2 |
import { format } from "date-fns"; |
import { format } from "date-fns"; |
3 |
import { appendFile } from "fs/promises"; |
import { appendFile } from "fs/promises"; |
4 |
import path from "path"; |
import path from "path"; |
5 |
|
import { exit } from "process"; |
6 |
import DiscordClient from "../../client/Client"; |
import DiscordClient from "../../client/Client"; |
7 |
import BaseEvent from "../../utils/structures/BaseEvent"; |
import BaseEvent from "../../utils/structures/BaseEvent"; |
8 |
|
|
20 |
return; |
return; |
21 |
} |
} |
22 |
|
|
23 |
|
if (process.env.PLATFORM === 'replit' && e.includes("Hit a 429 while executing a request") && !client.isReady()) { |
24 |
|
exec("kill 1"); |
25 |
|
return; |
26 |
|
} |
27 |
|
|
28 |
console.log("DEBUG: ", e); |
console.log("DEBUG: ", e); |
29 |
await appendFile(this.logFile, `[${format(new Date(), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}] [LOG] ${e}\n`); |
await appendFile(this.logFile, `[${format(new Date(), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}] [LOG] ${e}\n`); |
30 |
} |
} |