mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 16:53:57 +00:00
fix(bots/discord): connect to discord API even if initial bot API connection fails
This commit is contained in:
@@ -26,5 +26,5 @@ on('disconnect', (reason, msg) => {
|
|||||||
logger.info(
|
logger.info(
|
||||||
`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(() => ws.connect(), 10000)
|
setTimeout(() => api.client.connect(), 10000)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ for (const event of listAllFilesRecursive(pathJoinCurrentDir(import.meta.url, 'e
|
|||||||
await import(event)
|
await import(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
await api.client.connect()
|
api.client.connect()
|
||||||
|
|
||||||
for (const event of listAllFilesRecursive(pathJoinCurrentDir(import.meta.url, 'events', 'discord'))) {
|
for (const event of listAllFilesRecursive(pathJoinCurrentDir(import.meta.url, 'events', 'discord'))) {
|
||||||
await import(event)
|
await import(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
await discord.client.login()
|
discord.client.login()
|
||||||
|
|||||||
Reference in New Issue
Block a user