mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(bots/discord): hanging process when disconnecting from API too many times
This commit is contained in:
@@ -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(),
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user