mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
fix: unused
This commit is contained in:
parent
7c70f362fb
commit
364148ccf7
@ -188,7 +188,7 @@ export class BaseClient {
|
||||
return new Router(this.rest).createProxy();
|
||||
}
|
||||
|
||||
setServices({ rest, cache, langs, middlewares, handlers, handleCommand }: ServicesOptions) {
|
||||
setServices({ rest, cache, langs, middlewares, handleCommand }: ServicesOptions) {
|
||||
if (rest) {
|
||||
this.rest = rest;
|
||||
}
|
||||
@ -234,35 +234,6 @@ export class BaseClient {
|
||||
if (middlewares) {
|
||||
this.middlewares = middlewares;
|
||||
}
|
||||
if (handlers) {
|
||||
if ('components' in handlers) {
|
||||
if (!handlers.components) {
|
||||
this.components = undefined;
|
||||
} else if (typeof handlers.components === 'function') {
|
||||
this.components ??= new ComponentHandler(this.logger, this);
|
||||
} else {
|
||||
this.components = handlers.components;
|
||||
}
|
||||
}
|
||||
if ('commands' in handlers) {
|
||||
if (!handlers.commands) {
|
||||
this.commands = undefined;
|
||||
} else if (typeof handlers.commands === 'object') {
|
||||
this.commands ??= new CommandHandler(this.logger, this);
|
||||
} else {
|
||||
this.commands = handlers.commands;
|
||||
}
|
||||
}
|
||||
if ('langs' in handlers) {
|
||||
if (!handlers.langs) {
|
||||
this.langs = undefined;
|
||||
} else if (typeof handlers.langs === 'function') {
|
||||
this.langs ??= new LangsHandler(this.logger);
|
||||
} else {
|
||||
this.langs = handlers.langs;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (langs) {
|
||||
if (langs.default) this.langs!.defaultLang = langs.default;
|
||||
if (langs.aliases) this.langs!.aliases = Object.entries(langs.aliases);
|
||||
@ -565,10 +536,5 @@ export interface ServicesOptions {
|
||||
aliases?: Record<string, LocaleString[]>;
|
||||
};
|
||||
middlewares?: Record<string, MiddlewareContext>;
|
||||
handlers?: {
|
||||
components?: ComponentHandler | ComponentHandler['callback'];
|
||||
commands?: CommandHandler;
|
||||
langs?: LangsHandler;
|
||||
};
|
||||
handleCommand?: typeof HandleCommand;
|
||||
}
|
||||
|
@ -40,9 +40,6 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
||||
...rest
|
||||
}: ServicesOptions & {
|
||||
gateway?: ShardManager;
|
||||
handlers?: ServicesOptions['handlers'] & {
|
||||
events?: EventHandler['callback'];
|
||||
};
|
||||
}) {
|
||||
super.setServices(rest);
|
||||
if (gateway) {
|
||||
@ -54,15 +51,6 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
||||
};
|
||||
this.gateway = gateway;
|
||||
}
|
||||
if (rest.handlers && 'events' in rest.handlers) {
|
||||
if (!rest.handlers.events) {
|
||||
this.events = undefined;
|
||||
} else if (typeof rest.handlers.events === 'function') {
|
||||
this.events = new EventHandler(this);
|
||||
} else {
|
||||
this.events = rest.handlers.events;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async loadEvents(dir?: string) {
|
||||
|
@ -78,26 +78,11 @@ export class WorkerClient<Ready extends boolean = boolean> extends BaseClient {
|
||||
return acc / this.shards.size;
|
||||
}
|
||||
|
||||
setServices({
|
||||
...rest
|
||||
}: ServicesOptions & {
|
||||
handlers?: ServicesOptions['handlers'] & {
|
||||
events?: EventHandler['callback'];
|
||||
};
|
||||
}) {
|
||||
setServices(rest: ServicesOptions) {
|
||||
super.setServices(rest);
|
||||
if (rest.cache) {
|
||||
this.__setServicesCache = true;
|
||||
}
|
||||
if (rest.handlers && 'events' in rest.handlers) {
|
||||
if (!rest.handlers.events) {
|
||||
this.events = undefined;
|
||||
} else if (typeof rest.handlers.events === 'function') {
|
||||
this.events = new EventHandler(this);
|
||||
} else {
|
||||
this.events = rest.handlers.events;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setWorkerData(data: WorkerData) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user