Skip to content

Commit

Permalink
double logging no more
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed May 20, 2024
1 parent 680b329 commit 6e1db4e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 60 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,4 +15,4 @@ SUCCESS_EMOJI=
FAIL_EMOJI=
WEBSERVER_PORT=
DATABASE_URL=
SIMULATED_BAN_SHARE_KEY=
SIMULATED_BAN_SHARE_KEY=
27 changes: 0 additions & 27 deletions src/handlers/spam.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
],
});
}
}
}
);

Expand Down
1 change: 0 additions & 1 deletion src/types/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
30 changes: 0 additions & 30 deletions src/webserver/banshare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 6e1db4e

Please sign in to comment.