From 603bf7531b08a11197e42d4ed116bf2ea5f01bc4 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 5 Nov 2021 17:21:59 +0000 Subject: [PATCH] fix gateway intents --- src/bot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index 07d00846a..a4ba8c702 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -395,7 +395,7 @@ export function createGatewayManager( $os: options.$os ?? "linux", $browser: options.$browser ?? "Discordeno", $device: options.$device ?? "Discordeno", - intents: options.intents ?? 0, + intents: (Array.isArray(options.intents) ? options.intents.reduce((bits, next) => (bits |= DiscordGatewayIntents[next]), 0) : options.intents) ?? 0, shard: options.shard ?? [0, options.shardsRecommended ?? 1], urlWSS: options.urlWSS ?? "wss://gateway.discord.gg/?v=9&encoding=json", shardsRecommended: options.shardsRecommended ?? 1, @@ -894,7 +894,7 @@ export interface GatewayManager { $os: string; $browser: string; $device: string; - intents: number; + intents: number | (keyof typeof DiscordGatewayIntents)[]; shard: [number, number]; /** The WSS URL that can be used for connecting to the gateway. */