mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
stop crying
This commit is contained in:
parent
4047279a7b
commit
3e06f9db97
@ -84,16 +84,11 @@ export function createAttachmentOption<T extends SeyfertAttachmentOption = Seyfe
|
||||
return { ...data, type: ApplicationCommandOptionType.Attachment } as const;
|
||||
}
|
||||
|
||||
export type ParseMiddlewareType<T> = T extends MiddlewareContext<
|
||||
any,
|
||||
CommandContext | MenuCommandContext<MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>>
|
||||
>
|
||||
? T
|
||||
: MiddlewareContext<
|
||||
T,
|
||||
CommandContext | MenuCommandContext<MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>>
|
||||
>;
|
||||
|
||||
export function createMiddleware<T = ParseMiddlewareType<unknown>>(data: ParseMiddlewareType<T>) {
|
||||
export function createMiddleware<
|
||||
T = any,
|
||||
C extends CommandContext | MenuCommandContext<MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>> =
|
||||
| CommandContext
|
||||
| MenuCommandContext<MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>>,
|
||||
>(data: MiddlewareContext<T, C>) {
|
||||
return data;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user