2020-05-16 15:03:21 -04:00
import { Client , Event } from '../class' ;
2020-04-14 21:34:09 -04:00
2020-05-16 15:03:21 -04:00
export default class Ready extends Event {
2020-04-14 21:34:09 -04:00
public client : Client ;
constructor ( client : Client ) {
2020-05-16 15:03:21 -04:00
super ( client ) ;
this . event = 'ready' ;
2020-04-14 21:34:09 -04:00
}
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 ) ;
} ) ;
2020-04-16 22:56:52 -04:00
process . on ( 'unhandledRejection' , ( err : Error ) = > {
this . client . util . handleError ( err ) ;
2020-04-14 21:34:09 -04:00
} ) ;
}
}