From 361326c31ec491a79cac8f3e9bbcac4140cb2da1 Mon Sep 17 00:00:00 2001 From: Lukas | AstroGD Date: Tue, 29 Nov 2022 00:23:19 +0100 Subject: [PATCH] Fix: Add empty function to catch clauses --- src/commands/blocklist.ts | 12 ++++++------ src/commands/index.ts | 2 +- src/commands/info.ts | 2 +- src/commands/logchannel.ts | 12 ++++++------ src/commands/preserveSettings.ts | 4 ++-- src/commands/showSettings.ts | 2 +- src/commands/showblocklist.ts | 2 +- src/events/channelUpdate.ts | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/commands/blocklist.ts b/src/commands/blocklist.ts index 6d6878f..9551e09 100644 --- a/src/commands/blocklist.ts +++ b/src/commands/blocklist.ts @@ -70,7 +70,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); return; } @@ -89,7 +89,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); return; } @@ -117,7 +117,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise if (logChannel && logChannel.isTextBased()) { logChannel.send({ embeds: [logMessage] - }).catch(); + }).catch(() => {}); } break; } @@ -138,7 +138,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); return; } @@ -151,7 +151,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); const logMessage = getDefaultEmbed(); logMessage.setTitle(`${Emoji.SETTINGS} Word removed`); @@ -164,7 +164,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise if (logChannel && logChannel.isTextBased()) { logChannel.send({ embeds: [logMessage] - }).catch(); + }).catch(() => {}); } break; } diff --git a/src/commands/index.ts b/src/commands/index.ts index 78761e7..86fa211 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -44,6 +44,6 @@ client.on(Events.InteractionCreate, async (interaction) => { await interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); } }); \ No newline at end of file diff --git a/src/commands/info.ts b/src/commands/info.ts index 5d39176..b6c724b 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -57,7 +57,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); } export { diff --git a/src/commands/logchannel.ts b/src/commands/logchannel.ts index c9cf5a9..0f0f88e 100644 --- a/src/commands/logchannel.ts +++ b/src/commands/logchannel.ts @@ -35,7 +35,7 @@ async function resetNotificationChannel(guildSetting: GuildSetting, interaction: if (logChannel && logChannel.isTextBased()) { logChannel.send({ embeds: [logEmbed] - }).catch(); + }).catch(() => {}); } const embed = getSuccessEmbed(); @@ -43,7 +43,7 @@ async function resetNotificationChannel(guildSetting: GuildSetting, interaction: interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); } const execute = async (interaction: ChatInputCommandInteraction) => { @@ -64,7 +64,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => { interaction.reply({ embeds: [ embed ], ephemeral: true - }).catch(); + }).catch(() => {}); return; } @@ -82,7 +82,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => { if (oldLogChannel && oldLogChannel.isTextBased()) { oldLogChannel.send({ embeds: [embed] - }).catch(); + }).catch(() => {}); } } @@ -99,7 +99,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => { channel.send({ embeds: [embed] - }).catch(); + }).catch(() => {}); const reply = getSuccessEmbed(); reply.setDescription(`Log channel was set to <#${channel.id}>`); @@ -107,7 +107,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => { interaction.reply({ embeds: [reply], ephemeral: true - }).catch(); + }).catch(() => {}); return; } diff --git a/src/commands/preserveSettings.ts b/src/commands/preserveSettings.ts index 90f0bfd..5536474 100644 --- a/src/commands/preserveSettings.ts +++ b/src/commands/preserveSettings.ts @@ -42,7 +42,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: [embed], ephemeral: true - }).catch(); + }).catch(() => {}); if (!settings.notificationChannelID) return; const logChannel = await getGuildChannel(interaction.guildId, settings.notificationChannelID); @@ -57,7 +57,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise logChannel.send({ embeds: [logEmbed] - }).catch(); + }).catch(() => {}); } export { diff --git a/src/commands/showSettings.ts b/src/commands/showSettings.ts index dc003f9..1825f8f 100644 --- a/src/commands/showSettings.ts +++ b/src/commands/showSettings.ts @@ -71,7 +71,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ embeds: embeds, ephemeral: true - }).catch(); + }).catch(() => {}); } export { diff --git a/src/commands/showblocklist.ts b/src/commands/showblocklist.ts index 347f9a4..acbcb64 100644 --- a/src/commands/showblocklist.ts +++ b/src/commands/showblocklist.ts @@ -32,7 +32,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise interaction.reply({ content: `\`\`\`Global bad word list\`\`\`\n||${globalBadWords.map((word) => word.value).reduce((prev, next) => prev + ", " + next, "").slice(2)} ||\n\`\`\`Local server bad word list (${guildBadWords.length}/${isPremium ? 100 : 10})\`\`\`\n||${guildBadWords.map((word) => word.value).reduce((prev, next) => prev + ", " + next, "").slice(2)} ||`, ephemeral: true - }).catch(); + }).catch(() => {}); } export { diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts index 9d41d2b..14f77ec 100644 --- a/src/events/channelUpdate.ts +++ b/src/events/channelUpdate.ts @@ -60,7 +60,7 @@ client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => { logChannel.send({ embeds: [embed] - }).catch(); + }).catch(() => {}); return; } @@ -81,5 +81,5 @@ client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => { logChannel.send({ embeds: [embed] - }).catch(); + }).catch(() => {}); }); \ No newline at end of file