forked from engineering/cloudservices
add event listeners on process in client
parent
fae3eab310
commit
aaeb35719f
|
@ -40,10 +40,17 @@ export default class Client extends Eris.Client {
|
||||||
displayTimestamp: true,
|
displayTimestamp: true,
|
||||||
displayFilename: true,
|
displayFilename: true,
|
||||||
});
|
});
|
||||||
|
this.events();
|
||||||
this.loadFunctions();
|
this.loadFunctions();
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async events() {
|
||||||
|
process.on('unhandledRejection', (error) => {
|
||||||
|
this.signale.error(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private async loadFunctions() {
|
private async loadFunctions() {
|
||||||
const functions = await fs.readdir('./functions');
|
const functions = await fs.readdir('./functions');
|
||||||
functions.forEach(async (func) => {
|
functions.forEach(async (func) => {
|
||||||
|
|
Loading…
Reference in New Issue