/[sudobot]/trunk/src/client/Client.ts
ViewVC logotype

Diff of /trunk/src/client/Client.ts

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

revision 268 by rakin, Mon Jul 29 17:29:17 2024 UTC revision 372 by rakin, Mon Jul 29 17:29:50 2024 UTC
# Line 4  import BaseCommand from '../utils/struct Line 4  import BaseCommand from '../utils/struct
4  import { Config } from './Config';  import { Config } from './Config';
5  import Database from './Database';  import Database from './Database';
6  import path from 'path';  import path from 'path';
7    import { appendFile } from "fs/promises";
8  import Logger from '../automod/Logger';  import Logger from '../automod/Logger';
9  import SnippetManager from '../services/SnippetManager';  import SnippetManager from '../services/SnippetManager';
10  import AFKEngine from '../services/AFKEngine';  import AFKEngine from '../services/AFKEngine';
# Line 109  export default class DiscordClient exten Line 110  export default class DiscordClient exten
110          DiscordClient.client = this;          DiscordClient.client = this;
111    
112          this.config = new Config(this);          this.config = new Config(this);
113          this.db = new Database(path.resolve(rootdir, 'database.db'), this);          this.db = new Database(this);
114          this.serviceManager = new ServiceManager(this, this.aliases);          this.serviceManager = new ServiceManager(this, this.aliases);
115          this.serviceManager.load(this.services);          this.serviceManager.load(this.services);
116    
# Line 154  export default class DiscordClient exten Line 155  export default class DiscordClient exten
155    
156      async handleCrash(error: Error, origin: NodeJS.UncaughtExceptionOrigin) {      async handleCrash(error: Error, origin: NodeJS.UncaughtExceptionOrigin) {
157          console.log('here');          console.log('here');
158            await appendFile(path.join(process.env.SUDO_PREFIX ?? (__dirname + "/../../"), "logs", "error.log"), `Uncaught ${error.name}: ${error.message}\n+ ${error.stack}`);
159          await this.debugLogger.logToHomeServer(`Uncaught ${error.name}: ${error.message}\n${error.stack}`);          await this.debugLogger.logToHomeServer(`Uncaught ${error.name}: ${error.message}\n${error.stack}`);
160      }      }
161  }  }

Legend:
Removed from v.268  
changed lines
  Added in v.372

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26