diff --git a/src/client/base.ts b/src/client/base.ts index 9806910..09a1271 100644 --- a/src/client/base.ts +++ b/src/client/base.ts @@ -296,7 +296,11 @@ export type RuntimeConfigHTTP = Omit, 'publicKey' | 'port'>; -export type RuntimeConfig = OmitInsert; +export type RuntimeConfig = OmitInsert< + InternalRuntimeConfig, + 'intents', + { intents?: IntentStrings | number[] | number } +>; export interface ServicesOptions { rest?: ApiHandler; diff --git a/src/index.ts b/src/index.ts index da1e5c1..fda7e43 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,7 +68,10 @@ export const config = { 'intents' in data ? typeof data.intents === 'number' ? data.intents - : data.intents?.reduce((pr, acc) => pr | GatewayIntentBits[acc], 0) ?? 0 + : data.intents?.reduce( + (pr, acc) => pr | (typeof acc === 'number' ? acc : GatewayIntentBits[acc]), + 0, + ) ?? 0 : 0, } as InternalRuntimeConfig; },