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;
|
||||
|
||||
/** @internal */
|
||||
async _filter(context: ComponentContext) {
|
||||
const old = (await this.filter?.(context)) ?? true;
|
||||
if (this.customId) return this.customId === context.customId && old;
|
||||
return old;
|
||||
_filter(context: ComponentContext) {
|
||||
if (this.customId && this.customId !== context.customId) return false;
|
||||
if (this.filter) return this.filter(context);
|
||||
return true;
|
||||
}
|
||||
|
||||
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
||||
|
@ -13,10 +13,10 @@ export abstract class ModalCommand {
|
||||
abstract run(context: ModalContext): any;
|
||||
|
||||
/** @internal */
|
||||
async _filter(context: ModalContext) {
|
||||
const old = (await this.filter?.(context)) ?? true;
|
||||
if (this.customId) return this.customId === context.customId && old;
|
||||
return old;
|
||||
_filter(context: ModalContext) {
|
||||
if (this.customId && this.customId !== context.customId) return false;
|
||||
if (this.filter) return this.filter(context);
|
||||
return true;
|
||||
}
|
||||
|
||||
middlewares: (keyof RegisteredMiddlewares)[] = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user