From 5c2701fba776c6836d1faacbf5f1bf0ce155b308 Mon Sep 17 00:00:00 2001 From: jacoobes Date: Sun, 13 Feb 2022 22:39:51 -0600 Subject: [PATCH] fix eslint-caught semis --- src/handler/Utilities/readFile.ts | 2 +- src/handler/logger.ts | 2 +- src/handler/sern.ts | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/handler/Utilities/readFile.ts b/src/handler/Utilities/readFile.ts index 9a6917f..9fc78ba 100644 --- a/src/handler/Utilities/readFile.ts +++ b/src/handler/Utilities/readFile.ts @@ -55,7 +55,7 @@ export async function buildData(handler: Sern.Handler) const commandDir = handler.commandDir; return Promise.all((await getCommands(commandDir)) .map(async absPath => { - return { name: basename(absPath), mod: (await import(absPath)).default as Sern.Module, absPath } + return { name: basename(absPath), mod: (await import(absPath)).default as Sern.Module, absPath }; })); } diff --git a/src/handler/logger.ts b/src/handler/logger.ts index b5343dd..d325452 100644 --- a/src/handler/logger.ts +++ b/src/handler/logger.ts @@ -12,7 +12,7 @@ enum sEvent { export default class Logger { - public clear() { console.clear() } + public clear() { console.clear(); } public log(e : T, message: string) { dayJS.extend(UTC); diff --git a/src/handler/sern.ts b/src/handler/sern.ts index b1f714c..2a01e30 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -44,7 +44,7 @@ export class Handler { .on('ready', async () => { Files.buildData(this) - .then(data => this.registerModules(data)) + .then(data => this.registerModules(data)); if (wrapper.init !== undefined) wrapper.init(this); }) @@ -55,10 +55,10 @@ export class Handler { const tryFmt = fmt(message, this.prefix); const module = this.findCommand(tryFmt.shift()!); if (module === undefined) { - message.channel.send('Unknown legacy command') + message.channel.send('Unknown legacy command'); return; } - const cmdResult = (await this.commandResult(module, message, tryFmt.join(' '))) + const cmdResult = (await this.commandResult(module, message, tryFmt.join(' '))); if (cmdResult === undefined) return; message.channel.send(cmdResult); @@ -90,7 +90,7 @@ export class Handler { if (name === undefined) `${interaction.commandName} is not a valid command!`; if (module.mod.type < CommandType.SLASH) return 'This is not a slash command'; - const context = { message: None, interaction: Some(interaction) } + const context = { message: None, interaction: Some(interaction) }; const parsedArgs = module.mod.parse?.(context, ['slash', interaction.options]) ?? Ok(''); if (parsedArgs.err) return parsedArgs.val; @@ -108,7 +108,7 @@ export class Handler { private async commandResult(module: Files.CommandVal | undefined, message: Message, args: string): Promise { if (module?.mod === undefined) return 'Unknown legacy command'; - if (module.mod.type === CommandType.SLASH) return `This may be a slash command and not a legacy command` + if (module.mod.type === CommandType.SLASH) return `This may be a slash command and not a legacy command`; if (module.mod.visibility === 'private') { const checkIsTestServer = this.privateServers.find(({ id }) => id === message.guildId!)?.test; if (checkIsTestServer === undefined) return 'This command has the private modifier but is not registered under Handler#privateServers'; @@ -121,7 +121,7 @@ export class Handler { const context = { message: Some(message), interaction: None - } + }; const parsedArgs = module.mod.parse?.(context, ['text', args]) ?? Ok(''); if (parsedArgs.err) return parsedArgs.val; return (await module.mod.delegate(context, parsedArgs))?.val; @@ -145,12 +145,12 @@ export class Handler { case 1: Files.Commands.set(cmdName, { mod, options: [] }); break; case 2: case (1 | 2): { - const options = ((await import(absPath)).options as ApplicationCommandOptionData[]) + const options = ((await import(absPath)).options as ApplicationCommandOptionData[]); Files.Commands.set(cmdName, { mod, options: options ?? [] }); switch (mod.visibility) { case 'private': { // Reloading guild slash commands - await this.reloadSlash(cmdName, mod.desc, options) + await this.reloadSlash(cmdName, mod.desc, options); } case 'public': { // Creating global commands @@ -169,7 +169,7 @@ export class Handler { if (mod.alias.length > 0) { for (const alias of mod.alias) { - Files.Alias.set(alias, { mod, options: [] }) + Files.Alias.set(alias, { mod, options: [] }); } } }