fix: deno ws fix

This commit is contained in:
Skillz
2023-05-08 14:02:18 -05:00
parent 9de1f66bca
commit c675b450c1
+8
View File
@@ -67,6 +67,14 @@ export function createBot(options: CreateBotOptions): Bot {
// Set up helpers below.
helpers: {} as BotHelpers,
async start() {
// @ts-expect-error should this work
if (typeof Deno !== 'undefined') {
// @ts-expect-error should this work
const katsura = await import('https://x.nest.land/katsura@1.3.9/src/discordenoFixes/gatewaySocket.ts')
await katsura(bot.gateway)
}
if (!options.gateway?.connection) {
bot.gateway.connection = await bot.rest.getSessionInfo()
}