diff --git a/src/commands/faithful/faq.ts b/src/commands/faithful/faq.ts index a7a912d33..059fd127f 100644 --- a/src/commands/faithful/faq.ts +++ b/src/commands/faithful/faq.ts @@ -18,13 +18,12 @@ export const command: SlashCommand = { if (choice == "all") { if ( await interaction.perms({ - type: "manager" + type: "manager", }) ) return; - interaction.reply({ content: "** **", ephemeral: true, fetchReply: true }) - .then((message: Message) => message.delete()); + interaction.reply({ content: "** **", ephemeral: true }); let embedArray = []; let i = 0; @@ -35,8 +34,8 @@ export const command: SlashCommand = { .setTitle(faq.question) .setDescription(faq.answer) .setColor(colors.brand) - .setFooter({ text: `Keywords: ${faq.keywords.join(" • ")}` }) - ) + .setFooter({ text: `Keywords: ${faq.keywords.join(" • ")}` }), + ); if ((i + 1) % 5 == 0) { // groups the embeds in batches of 5 to reduce API spam diff --git a/src/commands/faithful/rule.ts b/src/commands/faithful/rule.ts index 31ab55161..7e4d71d64 100644 --- a/src/commands/faithful/rule.ts +++ b/src/commands/faithful/rule.ts @@ -12,7 +12,8 @@ export const command: SlashCommand = { option .setName("number") .setDescription("Which rule to view") - .addChoices( // using the value as an array index + .addChoices( + // using the value as an array index { name: "1", value: "0" }, { name: "2", value: "1" }, { name: "3", value: "2" }, @@ -33,13 +34,19 @@ export const command: SlashCommand = { if (choice == "all") { if (await interaction.perms({ type: "manager" })) return; - interaction.reply({ content: "** **", ephemeral: true, fetchReply: true }) - .then((message: Message) => message.delete()); + interaction.reply({ content: "** **", ephemeral: true }); // I hate this so much but there's not much I can do - const thumbnail = interaction.guildId == (interaction.client as Client).config.discords.find((obj) => obj.name == "classic_faithful").id - ? `${(interaction.client as Client).config.images}branding/logos/transparent/128/cf_plain_logo.png` - : `${(interaction.client as Client).config.images}branding/logos/transparent/128/plain_logo.png`; + const thumbnail = + interaction.guildId == + (interaction.client as Client).config.discords.find((obj) => obj.name == "classic_faithful") + .id + ? `${ + (interaction.client as Client).config.images + }branding/logos/transparent/128/cf_plain_logo.png` + : `${ + (interaction.client as Client).config.images + }branding/logos/transparent/128/plain_logo.png`; let embedArray = []; let i = 0; @@ -49,17 +56,17 @@ export const command: SlashCommand = { .setTitle(ruleStrings.rules_info.heading.title) .setDescription(ruleStrings.rules_info.heading.description) .setColor(colors.brand) - .setThumbnail(thumbnail) - ] - }) + .setThumbnail(thumbnail), + ], + }); for (let rule of ruleStrings.rules) { embedArray.push( new MessageEmbed() .setTitle(rule.title) .setDescription(rule.description) - .setColor(colors.brand) - ) + .setColor(colors.brand), + ); if ((i + 1) % 5 == 0) { await interaction.channel.send({ embeds: embedArray }); @@ -91,14 +98,16 @@ export const command: SlashCommand = { } const ruleChoice = ruleStrings.rules[choice]; - return await interaction.reply({ - embeds: [ - new MessageEmbed() - .setTitle(ruleChoice.title) - .setDescription(ruleChoice.description) - .setThumbnail(`${(interaction.client as Client).config.images}bot/rules.png`) - ], - fetchReply: true, - }).then((message: Message) => message.deleteButton()) + return await interaction + .reply({ + embeds: [ + new MessageEmbed() + .setTitle(ruleChoice.title) + .setDescription(ruleChoice.description) + .setThumbnail(`${(interaction.client as Client).config.images}bot/rules.png`), + ], + fetchReply: true, + }) + .then((message: Message) => message.deleteButton()); }, }; diff --git a/src/helpers/permissions/slashCommandPermissions.ts b/src/helpers/permissions/slashCommandPermissions.ts index 91965cd47..45985199c 100644 --- a/src/helpers/permissions/slashCommandPermissions.ts +++ b/src/helpers/permissions/slashCommandPermissions.ts @@ -90,7 +90,7 @@ export function checkPermissions( type = "config"; permissions = { roles: ["manager"], - } + }; default: break; }