added error handling + log

This commit is contained in:
Win 2024-05-29 05:05:41 +07:00
parent 466686db7a
commit d60d217f5b
2 changed files with 9 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 279 KiB

View File

@ -92,6 +92,7 @@ client.on('ready', () => {
console.log("New: " + radar_image_size); console.log("New: " + radar_image_size);
if(radar_image_size != curr_image_size) { if(radar_image_size != curr_image_size) {
console.log("File change detected!");
let message = await channel.send({ let message = await channel.send({
content: radar_caption, content: radar_caption,
files: [curr_image_path] files: [curr_image_path]
@ -104,4 +105,12 @@ client.on('ready', () => {
})(); })();
}); });
client.on(Events.ShardError, error => {
console.log('A websocket connection encountered an error: ', error);
});
process.on('unhandledRejection', error => {
console.error(error);
});
client.login(config.token); client.login(config.token);