Rework bot function #13

Merged
AstroGD merged 15 commits from feature/12-show-warning-if-logchannel-is-unreachable into dev 2022-11-29 03:07:01 +01:00
8 changed files with 20 additions and 20 deletions
Showing only changes of commit 361326c31e - Show all commits

View File

@ -70,7 +70,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({
embeds: [embed],
ephemeral: true
}).catch();
}).catch(() => {});
return;
}
@ -89,7 +89,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({
embeds: [embed],
ephemeral: true
}).catch();
}).catch(() => {});
return;
}
@ -117,7 +117,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
if (logChannel && logChannel.isTextBased()) {
logChannel.send({
embeds: [logMessage]
}).catch();
}).catch(() => {});
}
break;
}
@ -138,7 +138,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
interaction.reply({
embeds: [embed],
ephemeral: true
}).catch();
}).catch(() => {});
return;
}
@ -151,7 +151,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
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<void>
if (logChannel && logChannel.isTextBased()) {
logChannel.send({
embeds: [logMessage]
}).catch();
}).catch(() => {});
}
break;
}

View File

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

View File

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

View File

@ -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;
}

View File

@ -42,7 +42,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
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<void>
logChannel.send({
embeds: [logEmbed]
}).catch();
}).catch(() => {});
}
export {

View File

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

View File

@ -32,7 +32,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
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 {

View File

@ -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(() => {});
});