From 7f76de01bcb7b9c9f96a1777759529ad1288e71b Mon Sep 17 00:00:00 2001 From: Szedann <65607498+Szedann@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:26:41 +0100 Subject: [PATCH] prettier --- src/handlers/button.handler.ts | 14 ++++++-------- src/webserver/banshare.ts | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/handlers/button.handler.ts b/src/handlers/button.handler.ts index 55098cf..5da7552 100644 --- a/src/handlers/button.handler.ts +++ b/src/handlers/button.handler.ts @@ -7,6 +7,7 @@ import { } from 'discord.js'; import { Handler } from '..'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any const buttonMap = new Map>(); export class Button { @@ -14,10 +15,7 @@ export class Button { _onPress?: (interaction: ButtonInteraction, args: ArgsType) => unknown; constructor( id: string, - onPress: ( - interaction: ButtonInteraction, - args: ArgsType - ) => unknown + onPress: (interaction: ButtonInteraction, args: ArgsType) => unknown ) { this.id = id; if (buttonMap.has(id)) console.error(`Button ${id} is already defined`); @@ -38,7 +36,7 @@ export class Button { } export const buttonHandler: Handler = (client) => { - client.on(Events.InteractionCreate, async (interaction:Interaction) => { + client.on(Events.InteractionCreate, async (interaction: Interaction) => { if (!interaction.isButton()) return; const data = JSON.parse(interaction.customId); const args = data.args; @@ -48,10 +46,10 @@ export const buttonHandler: Handler = (client) => { if (!button) return; if (!button._onPress) return; - try{ + try { button._onPress(interaction, args); - }catch{ - interaction.reply("error while executing") + } catch { + interaction.reply('error while executing'); } }); }; diff --git a/src/webserver/banshare.ts b/src/webserver/banshare.ts index b9b988c..9187144 100644 --- a/src/webserver/banshare.ts +++ b/src/webserver/banshare.ts @@ -14,7 +14,7 @@ import { Button } from '../handlers/button.handler'; const banButton = new Button( 'ban', - async (interaction, data:{userId:string}) => { + async (interaction, data: { userId: string }) => { const reason = 'aero banshare: ' + (interaction.message.embeds[0].fields[3].value ??