/[sudobot]/trunk/src/events/debug/DebugEvent.ts
ViewVC logotype

Diff of /trunk/src/events/debug/DebugEvent.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 291 by rakin, Mon Jul 29 17:29:22 2024 UTC revision 292 by rakin, Mon Jul 29 17:29:23 2024 UTC
# Line 1  Line 1 
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    
# Line 18  export default class DebugEvent extends Line 20  export default class DebugEvent extends
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      }      }

Legend:
Removed from v.291  
changed lines
  Added in v.292

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26