community-relations/src/events/ready.ts

26 lines
818 B
TypeScript
Raw Normal View History

2020-07-06 03:15:06 -04:00
import { Client, Event } from '../class';
export default class Ready extends Event {
public client: Client;
constructor(client: Client) {
super(client);
this.event = 'ready';
}
public async run() {
2020-07-19 20:08:55 -04:00
await this.client.loadIntervals();
2020-07-06 03:15:06 -04:00
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: Error) => {
this.client.util.handleError(err);
});
}
}