log revolt connection state changes

This commit is contained in:
Lea 2023-04-21 22:50:50 +02:00
parent 631584fa32
commit f6d5d8cf69
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -139,3 +139,22 @@ client.on('serverMemberJoin', (member) => {
embeds: [embed],
}).catch(e => logger.debug('Cannot send hello message: ' + e));
});
client.on('disconnected', () => logger.warn('Client disconnected!'));
client.events.on('state', (state) => {
switch(state) {
case 2:
logger.info('Connection state: Connected');
break;
case 1:
logger.info('Connection state: Connecting');
break;
case 3:
logger.info('Connection state: Disconnected');
break;
case 0:
logger.info('Connection state: Idle');
break;
}
});