mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 00:33:59 +00:00
feat(bots/discord): add api.disconnectRetryInterval config
This commit is contained in:
@@ -41,6 +41,7 @@ export type Config = {
|
|||||||
api: {
|
api: {
|
||||||
url: string
|
url: string
|
||||||
disconnectLimit?: number
|
disconnectLimit?: number
|
||||||
|
disconnectRetryInterval?: number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,5 +68,6 @@ export default {
|
|||||||
api: {
|
api: {
|
||||||
url: 'ws://127.0.0.1:3000',
|
url: 'ws://127.0.0.1:3000',
|
||||||
disconnectLimit: 3,
|
disconnectLimit: 3,
|
||||||
|
disconnectRetryInterval: 10000,
|
||||||
},
|
},
|
||||||
} satisfies Config as Config
|
} 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...`,
|
`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