mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat(bots/discord): add api.disconnectRetryInterval config
This commit is contained in:
@@ -41,6 +41,7 @@ export type Config = {
|
||||
api: {
|
||||
url: string
|
||||
disconnectLimit?: number
|
||||
disconnectRetryInterval?: number
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,5 +68,6 @@ export default {
|
||||
api: {
|
||||
url: 'ws://127.0.0.1:3000',
|
||||
disconnectLimit: 3,
|
||||
disconnectRetryInterval: 10000,
|
||||
},
|
||||
} satisfies Config as Config
|
||||
|
||||
@@ -25,5 +25,5 @@ withContext(on, 'disconnect', ({ api, config, logger }, reason, msg) => {
|
||||
`Disconnected from bot API ${++api.disconnectCount} times (this time because: ${reason}, ${msg}), reconnecting again...`,
|
||||
)
|
||||
|
||||
setTimeout(() => api.client.connect(), 10000)
|
||||
setTimeout(() => api.client.connect(), config.api.disconnectRetryInterval)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user