From 6e1db4ed26d3b2d324d90eade1d7e54f80dc17dd Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 20 May 2024 11:37:12 -0400 Subject: [PATCH] double logging no more --- .env.example | 3 +-- src/handlers/spam.handler.ts | 27 --------------------------- src/types/environment.d.ts | 1 - src/webserver/banshare.ts | 30 ------------------------------ 4 files changed, 1 insertion(+), 60 deletions(-) diff --git a/.env.example b/.env.example index 7c6cbb5..cf43f74 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,6 @@ SERVER_ID= SAY_LOGS_CHANNEL= LOGS_CHANNEL= SIMULATED_BAN_SHARE_LOGS_CHANNEL= -BAN_LOGS_CHANNEL= MESSAGE_LOGS_CHANNEL= # These arent needed outside of production @@ -16,4 +15,4 @@ SUCCESS_EMOJI= FAIL_EMOJI= WEBSERVER_PORT= DATABASE_URL= -SIMULATED_BAN_SHARE_KEY= \ No newline at end of file +SIMULATED_BAN_SHARE_KEY= diff --git a/src/handlers/spam.handler.ts b/src/handlers/spam.handler.ts index 168666c..bec879e 100644 --- a/src/handlers/spam.handler.ts +++ b/src/handlers/spam.handler.ts @@ -40,33 +40,6 @@ const banModal = new Modal( ], }); } - if (interaction.guild != null) { - const channel = await interaction.guild.channels.fetch( - process.env.BAN_LOGS_CHANNEL - ); - if (channel?.isTextBased()) { - await channel.send({ - embeds: [ - new EmbedBuilder() - .setTitle('User Banned for spam') - .setDescription(`<@!${data.userId}> was banned!`) - .setFields([ - { - name: 'Reason', - value: interaction.components[0] - .components[0].value, - }, - ]) - .setAuthor({ - iconURL: - interaction.user.avatarURL({ size: 32 }) ?? - undefined, - name: interaction.user.username, - }), - ], - }); - } - } } ); diff --git a/src/types/environment.d.ts b/src/types/environment.d.ts index c4e22cc..b8430c1 100644 --- a/src/types/environment.d.ts +++ b/src/types/environment.d.ts @@ -7,7 +7,6 @@ declare global { SERVER_ID: string; SAY_LOGS_CHANNEL: string; LOGS_CHANNEL: string; - BAN_LOGS_CHANNEL: string; MESSAGE_LOGS_CHANNEL: string; MAVEN_REPO: string; GITHUB_STATUS_CHANNEL: string; diff --git a/src/webserver/banshare.ts b/src/webserver/banshare.ts index e337d33..ad65b14 100644 --- a/src/webserver/banshare.ts +++ b/src/webserver/banshare.ts @@ -39,36 +39,6 @@ const banModal = new Modal( ], }); } - if (interaction.guild != null) { - const channel = await interaction.guild.channels.fetch( - process.env.BAN_LOGS_CHANNEL - ); - if (channel?.isTextBased()) { - await channel.send({ - embeds: [ - new EmbedBuilder() - .setTitle('User Banned via Banshare') - .setDescription( - `<@!${data.userId}> was banned!` - ) - .setFields([ - { - name: 'Reason', - value: interaction.components[0] - .components[0].value, - }, - ]) - .setAuthor({ - name: interaction.user.username, - iconURL: - interaction.user.avatarURL({ - size: 32, - }) ?? undefined, - }), - ], - }); - } - } } catch (error) { console.error(error); await interaction.reply({