diff --git a/index.js b/index.js index c996344..9f55b06 100644 --- a/index.js +++ b/index.js @@ -261,5 +261,14 @@ client.on('interactionCreate', async interaction => { } }); +// Handle unhandled rejections and exceptions +process.on('unhandledRejection', error => { + console.error(`${colors.red('ERROR')} Unhandled promise rejection: ${error.stack}`); +}); + +process.on('uncaughtException', error => { + console.error(`${colors.red('ERROR')} Uncaught exception: ${error.stack}`); +}); + client.login(process.env.BOT_TOKEN); \ No newline at end of file