fix(bots/discord): hanging process when disconnecting from API too many times

This commit is contained in:
PalmDevs
2024-07-30 21:30:35 +07:00
parent 2efedc47df
commit d31616ebcb
6 changed files with 12 additions and 18 deletions

View File

@@ -35,8 +35,6 @@ export default {
data: new SlashCommandBuilder()
.setName("my-command")
.setDescription("My cool command")
// Allowing this command to be used in DMs
.setDMPermission(true)
// DO NOT forget this line!
.toJSON(),

View File

@@ -16,7 +16,7 @@ withContext(on, 'disconnect', ({ api, config, logger }, reason, msg) => {
)
if (api.disconnectCount >= (config.api.disconnectLimit ?? 3)) {
console.error('Disconnected from bot API too many times')
logger.fatal('Disconnected from bot API too many times')
// We don't want the process hanging
process.exit(1)
}