fix(bots/discord): connect to discord API even if initial bot API connection fails

This commit is contained in:
PalmDevs
2024-06-23 17:01:28 +07:00
parent c53a89ff99
commit 6658b582db
2 changed files with 3 additions and 3 deletions

View File

@@ -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)
}) })

View File

@@ -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()