mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +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)[] = [];
|
||||
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(
|
||||
protected logger: Logger,
|
||||
|
@ -127,7 +127,7 @@ export class BaseHandler {
|
||||
* @param path The path to filter.
|
||||
* @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.
|
||||
|
@ -27,7 +27,7 @@ export class ComponentHandler extends BaseHandler {
|
||||
// 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 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(
|
||||
logger: Logger,
|
||||
|
@ -54,7 +54,7 @@ export class EventHandler extends BaseHandler {
|
||||
|
||||
onFail = (event: GatewayEvents | CustomEventsKeys, err: unknown) =>
|
||||
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> = {};
|
||||
|
||||
|
@ -6,7 +6,7 @@ import type { LocaleString, Locale } from '../types';
|
||||
export class LangsHandler extends BaseHandler {
|
||||
values: Partial<Record<string, any>> = {};
|
||||
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');
|
||||
defaultLang?: string;
|
||||
aliases: [string, LocaleString[]][] = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user