Fix: Add empty function to catch clauses

This commit is contained in:
Lukas | AstroGD 2022-11-29 00:23:19 +01:00
parent f7c878854b
commit 361326c31e
Signed by: AstroGD
GPG Key ID: 82A5E6C236C535AA
8 changed files with 20 additions and 20 deletions

View File

@ -70,7 +70,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
return; return;
} }
@ -89,7 +89,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
return; return;
} }
@ -117,7 +117,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
if (logChannel && logChannel.isTextBased()) { if (logChannel && logChannel.isTextBased()) {
logChannel.send({ logChannel.send({
embeds: [logMessage] embeds: [logMessage]
}).catch(); }).catch(() => {});
} }
break; break;
} }
@ -138,7 +138,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
return; return;
} }
@ -151,7 +151,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
const logMessage = getDefaultEmbed(); const logMessage = getDefaultEmbed();
logMessage.setTitle(`${Emoji.SETTINGS} Word removed`); logMessage.setTitle(`${Emoji.SETTINGS} Word removed`);
@ -164,7 +164,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
if (logChannel && logChannel.isTextBased()) { if (logChannel && logChannel.isTextBased()) {
logChannel.send({ logChannel.send({
embeds: [logMessage] embeds: [logMessage]
}).catch(); }).catch(() => {});
} }
break; break;
} }

View File

@ -44,6 +44,6 @@ client.on(Events.InteractionCreate, async (interaction) => {
await interaction.reply({ await interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
} }
}); });

View File

@ -57,7 +57,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
} }
export { export {

View File

@ -35,7 +35,7 @@ async function resetNotificationChannel(guildSetting: GuildSetting, interaction:
if (logChannel && logChannel.isTextBased()) { if (logChannel && logChannel.isTextBased()) {
logChannel.send({ logChannel.send({
embeds: [logEmbed] embeds: [logEmbed]
}).catch(); }).catch(() => {});
} }
const embed = getSuccessEmbed(); const embed = getSuccessEmbed();
@ -43,7 +43,7 @@ async function resetNotificationChannel(guildSetting: GuildSetting, interaction:
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
} }
const execute = async (interaction: ChatInputCommandInteraction) => { const execute = async (interaction: ChatInputCommandInteraction) => {
@ -64,7 +64,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
interaction.reply({ interaction.reply({
embeds: [ embed ], embeds: [ embed ],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
return; return;
} }
@ -82,7 +82,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
if (oldLogChannel && oldLogChannel.isTextBased()) { if (oldLogChannel && oldLogChannel.isTextBased()) {
oldLogChannel.send({ oldLogChannel.send({
embeds: [embed] embeds: [embed]
}).catch(); }).catch(() => {});
} }
} }
@ -99,7 +99,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
channel.send({ channel.send({
embeds: [embed] embeds: [embed]
}).catch(); }).catch(() => {});
const reply = getSuccessEmbed(); const reply = getSuccessEmbed();
reply.setDescription(`Log channel was set to <#${channel.id}>`); reply.setDescription(`Log channel was set to <#${channel.id}>`);
@ -107,7 +107,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
interaction.reply({ interaction.reply({
embeds: [reply], embeds: [reply],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
return; return;
} }

View File

@ -42,7 +42,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: [embed], embeds: [embed],
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
if (!settings.notificationChannelID) return; if (!settings.notificationChannelID) return;
const logChannel = await getGuildChannel(interaction.guildId, settings.notificationChannelID); const logChannel = await getGuildChannel(interaction.guildId, settings.notificationChannelID);
@ -57,7 +57,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
logChannel.send({ logChannel.send({
embeds: [logEmbed] embeds: [logEmbed]
}).catch(); }).catch(() => {});
} }
export { export {

View File

@ -71,7 +71,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ interaction.reply({
embeds: embeds, embeds: embeds,
ephemeral: true ephemeral: true
}).catch(); }).catch(() => {});
} }
export { export {

View File

@ -32,7 +32,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({ 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)} ||`, 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 ephemeral: true
}).catch(); }).catch(() => {});
} }
export { export {

View File

@ -60,7 +60,7 @@ client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => {
logChannel.send({ logChannel.send({
embeds: [embed] embeds: [embed]
}).catch(); }).catch(() => {});
return; return;
} }
@ -81,5 +81,5 @@ client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => {
logChannel.send({ logChannel.send({
embeds: [embed] embeds: [embed]
}).catch(); }).catch(() => {});
}); });