1
0
Fork 0

add event listeners on process in client

refactor/models
Matthew 2019-10-27 20:54:48 -04:00
parent fae3eab310
commit aaeb35719f
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 7 additions and 0 deletions

View File

@ -40,10 +40,17 @@ export default class Client extends Eris.Client {
displayTimestamp: true,
displayFilename: true,
});
this.events();
this.loadFunctions();
this.init();
}
private async events() {
process.on('unhandledRejection', (error) => {
this.signale.error(error);
});
}
private async loadFunctions() {
const functions = await fs.readdir('./functions');
functions.forEach(async (func) => {