mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-05 06:26:08 +00:00
feat: expose filter method
This commit is contained in:
parent
364148ccf7
commit
0c7067f751
@ -23,7 +23,7 @@ export class CommandHandler extends BaseHandler {
|
|||||||
values: (Command | ContextMenuCommand)[] = [];
|
values: (Command | ContextMenuCommand)[] = [];
|
||||||
entryPoint: EntryPointCommand | null = null;
|
entryPoint: EntryPointCommand | null = null;
|
||||||
|
|
||||||
protected filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected logger: Logger,
|
protected logger: Logger,
|
||||||
|
@ -127,7 +127,7 @@ export class BaseHandler {
|
|||||||
* @param path The path to filter.
|
* @param path The path to filter.
|
||||||
* @returns `true` if the path passes the filter, otherwise `false`.
|
* @returns `true` if the path passes the filter, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
protected filter = (path: string) => !!path;
|
filter = (path: string) => !!path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively retrieves all files in a directory.
|
* Recursively retrieves all files in a directory.
|
||||||
|
@ -27,7 +27,7 @@ export class ComponentHandler extends BaseHandler {
|
|||||||
// 10 minutes timeout, because discord dont send an event when the user cancel the modal
|
// 10 minutes timeout, because discord dont send an event when the user cancel the modal
|
||||||
readonly modals = new LimitedCollection<string, ModalSubmitCallback>({ expire: 60e3 * 10 });
|
readonly modals = new LimitedCollection<string, ModalSubmitCallback>({ expire: 60e3 * 10 });
|
||||||
readonly commands: ComponentCommands[] = [];
|
readonly commands: ComponentCommands[] = [];
|
||||||
protected filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
|
@ -54,7 +54,7 @@ export class EventHandler extends BaseHandler {
|
|||||||
|
|
||||||
onFail = (event: GatewayEvents | CustomEventsKeys, err: unknown) =>
|
onFail = (event: GatewayEvents | CustomEventsKeys, err: unknown) =>
|
||||||
this.logger.warn('<Client>.events.onFail', err, event);
|
this.logger.warn('<Client>.events.onFail', err, event);
|
||||||
protected filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
filter = (path: string) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
||||||
|
|
||||||
values: Partial<EventValues> = {};
|
values: Partial<EventValues> = {};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import type { LocaleString, Locale } from '../types';
|
|||||||
export class LangsHandler extends BaseHandler {
|
export class LangsHandler extends BaseHandler {
|
||||||
values: Partial<Record<string, any>> = {};
|
values: Partial<Record<string, any>> = {};
|
||||||
private __paths: Partial<Record<string, string>> = {};
|
private __paths: Partial<Record<string, string>> = {};
|
||||||
protected filter = (path: string) =>
|
filter = (path: string) =>
|
||||||
path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts')) || path.endsWith('.json');
|
path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts')) || path.endsWith('.json');
|
||||||
defaultLang?: string;
|
defaultLang?: string;
|
||||||
aliases: [string, LocaleString[]][] = [];
|
aliases: [string, LocaleString[]][] = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user