mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
fix: intents can be number[] now
This commit is contained in:
parent
28fb9b8cda
commit
168aab508a
@ -296,7 +296,11 @@ export type RuntimeConfigHTTP = Omit<MakeRequired<RC, 'publicKey' | 'application
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type InternalRuntimeConfig = Omit<MakeRequired<RC, 'intents'>, 'publicKey' | 'port'>;
|
export type InternalRuntimeConfig = Omit<MakeRequired<RC, 'intents'>, 'publicKey' | 'port'>;
|
||||||
export type RuntimeConfig = OmitInsert<InternalRuntimeConfig, 'intents', { intents?: IntentStrings | number }>;
|
export type RuntimeConfig = OmitInsert<
|
||||||
|
InternalRuntimeConfig,
|
||||||
|
'intents',
|
||||||
|
{ intents?: IntentStrings | number[] | number }
|
||||||
|
>;
|
||||||
|
|
||||||
export interface ServicesOptions {
|
export interface ServicesOptions {
|
||||||
rest?: ApiHandler;
|
rest?: ApiHandler;
|
||||||
|
@ -68,7 +68,10 @@ export const config = {
|
|||||||
'intents' in data
|
'intents' in data
|
||||||
? typeof data.intents === 'number'
|
? typeof data.intents === 'number'
|
||||||
? data.intents
|
? data.intents
|
||||||
: data.intents?.reduce((pr, acc) => pr | GatewayIntentBits[acc], 0) ?? 0
|
: data.intents?.reduce<number>(
|
||||||
|
(pr, acc) => pr | (typeof acc === 'number' ? acc : GatewayIntentBits[acc]),
|
||||||
|
0,
|
||||||
|
) ?? 0
|
||||||
: 0,
|
: 0,
|
||||||
} as InternalRuntimeConfig;
|
} as InternalRuntimeConfig;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user