mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: check customId before filter
This commit is contained in:
parent
f74f29e96a
commit
e41711770c
@ -19,10 +19,10 @@ export abstract class ComponentCommand {
|
|||||||
abstract run(context: ComponentContext<typeof this.componentType>): any;
|
abstract run(context: ComponentContext<typeof this.componentType>): any;
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
async _filter(context: ComponentContext) {
|
_filter(context: ComponentContext) {
|
||||||
const old = (await this.filter?.(context)) ?? true;
|
if (this.customId && this.customId !== context.customId) return false;
|
||||||
if (this.customId) return this.customId === context.customId && old;
|
if (this.filter) return this.filter(context);
|
||||||
return old;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
||||||
|
@ -13,10 +13,10 @@ export abstract class ModalCommand {
|
|||||||
abstract run(context: ModalContext): any;
|
abstract run(context: ModalContext): any;
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
async _filter(context: ModalContext) {
|
_filter(context: ModalContext) {
|
||||||
const old = (await this.filter?.(context)) ?? true;
|
if (this.customId && this.customId !== context.customId) return false;
|
||||||
if (this.customId) return this.customId === context.customId && old;
|
if (this.filter) return this.filter(context);
|
||||||
return old;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user