mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
style(src): ran eslint through project
This commit is contained in:
@@ -69,7 +69,7 @@ export class Handler {
|
||||
if (interaction.guild === null) return; // TODO : handle dms
|
||||
const module = this.findModuleFrom(interaction);
|
||||
if (module === undefined) {
|
||||
interaction.channel!.send('Unknown slash command!')
|
||||
interaction.channel!.send('Unknown slash command!');
|
||||
return;
|
||||
}
|
||||
const res = await this.interactionResult(module, interaction);
|
||||
@@ -192,7 +192,7 @@ export class Handler {
|
||||
*/
|
||||
|
||||
private findModuleFrom<T extends Message | CommandInteraction>(ctx: T): Files.CommandVal | undefined {
|
||||
const name = ctx.applicationId === null ? fmt(ctx as Message, this.prefix).shift()! : (ctx as CommandInteraction).commandName
|
||||
const name = ctx.applicationId === null ? fmt(ctx as Message, this.prefix).shift()! : (ctx as CommandInteraction).commandName;
|
||||
const posCommand = Files.Commands.get(name) ?? Files.Alias.get(name);
|
||||
return posCommand;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Application, ApplicationCommandOptionData, Message } from 'discord.js';
|
||||
import type { OptionData } from './options';
|
||||
import type { Message } from 'discord.js';
|
||||
import type { OptionData } from '../../types/options';
|
||||
|
||||
type MsgFnArgs = [msgOrInter: Message, prefix?: string];
|
||||
type MsgFn = (...args: MsgFnArgs) => boolean;
|
||||
|
||||
@@ -19,8 +19,8 @@ export interface OptionData {
|
||||
AUTO: ApplicationCommandAutocompleteOption
|
||||
NUMBER: ApplicationCommandNumericOptionData
|
||||
INTEGER: ApplicationCommandNumericOptionData
|
||||
USER : { type: "USER" } & BaseOption
|
||||
MENTIONABLE: { type : "MENTIONABLE" } & BaseOption
|
||||
ROLE : { type: "ROLE" } & BaseOption
|
||||
BOOLEAN : { type: "BOOLEAN" } & BaseOption
|
||||
USER : { type: 'USER' } & BaseOption
|
||||
MENTIONABLE: { type : 'MENTIONABLE' } & BaseOption
|
||||
ROLE : { type: 'ROLE' } & BaseOption
|
||||
BOOLEAN : { type: 'BOOLEAN' } & BaseOption
|
||||
}
|
||||
Reference in New Issue
Block a user