mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +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 RuntimeConfig = OmitInsert<InternalRuntimeConfig, 'intents', { intents?: IntentStrings | number }>;
|
||||
export type RuntimeConfig = OmitInsert<
|
||||
InternalRuntimeConfig,
|
||||
'intents',
|
||||
{ intents?: IntentStrings | number[] | number }
|
||||
>;
|
||||
|
||||
export interface ServicesOptions {
|
||||
rest?: ApiHandler;
|
||||
|
@ -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<number>(
|
||||
(pr, acc) => pr | (typeof acc === 'number' ? acc : GatewayIntentBits[acc]),
|
||||
0,
|
||||
) ?? 0
|
||||
: 0,
|
||||
} as InternalRuntimeConfig;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user