add ready event w/ listeners for error events

merge-requests/1/merge
Matthew 2020-04-14 21:34:09 -04:00
parent b5be5c7d28
commit f3199c59d5
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 23 additions and 0 deletions

23
src/events/ready.ts Normal file
View File

@ -0,0 +1,23 @@
import { Client } from '../class';
export default class {
public client: Client;
constructor(client: Client) {
this.client = client;
}
public async run() {
this.client.util.signale.start(`${this.client.user.username} is now ready!\nServers: ${this.client.guilds.size}\nUsers: ${this.client.users.size}\n\nhttps://gitlab.libraryofcode.org/engineering/communityrelations`);
this.client.on('error', (err) => {
this.client.util.handleError(err);
});
process.on('uncaughtException', (err) => {
this.client.util.handleError(err);
process.exit(1);
});
process.on('unhandledRejection', (err) => {
this.client.util.handleError(new Error(err.toString()));
});
}
}