Bug fixes and ~~performance~~ typing improvements
diff --git a/src/commands/settings/logs/staff.ts b/src/commands/settings/logs/staff.ts
index a0df97c..8450bbb 100644
--- a/src/commands/settings/logs/staff.ts
+++ b/src/commands/settings/logs/staff.ts
@@ -1,10 +1,6 @@
import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
import { ChannelType } from "discord-api-types/v9";
-import Discord, {
- CommandInteraction,
- MessageActionRow,
- MessageButton
-} from "discord.js";
+import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
import EmojiEmbed from "../../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../../utils/confirmationMessage.js";
import getEmojiByName from "../../../utils/getEmojiByName.js";
@@ -20,16 +16,12 @@
.addChannelOption((option) =>
option
.setName("channel")
- .setDescription(
- "The channel to set the staff notifications channel to"
- )
+ .setDescription("The channel to set the staff notifications channel to")
.addChannelTypes([ChannelType.GuildNews, ChannelType.GuildText])
.setRequired(false)
);
-const callback = async (
- interaction: CommandInteraction
-): Promise<unknown | void> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown | void> => {
if (!interaction.guild) return;
const m = (await interaction.reply({
embeds: LoadingEmbed,
@@ -46,9 +38,7 @@
new EmojiEmbed()
.setEmoji("CHANNEL.TEXT.DELETE")
.setTitle("Staff Notifications Channel")
- .setDescription(
- "The channel you provided is not a valid channel"
- )
+ .setDescription("The channel you provided is not a valid channel")
.setStatus("Danger")
]
});
@@ -59,9 +49,7 @@
embeds: [
new EmojiEmbed()
.setTitle("Staff Notifications Channel")
- .setDescription(
- "You must choose a channel in this server"
- )
+ .setDescription("You must choose a channel in this server")
.setStatus("Danger")
.setEmoji("CHANNEL.TEXT.DELETE")
]
@@ -83,8 +71,7 @@
await client.database.guilds.write(interaction.guild.id, {
"logging.staff.channel": channel.id
});
- const { log, NucleusColors, entry, renderUser, renderChannel } =
- client.logger;
+ const { log, NucleusColors, entry, renderUser, renderChannel } = client.logger;
const data = {
meta: {
type: "staffChannelUpdate",
@@ -95,14 +82,8 @@
timestamp: new Date().getTime()
},
list: {
- memberId: entry(
- interaction.user.id,
- `\`${interaction.user.id}\``
- ),
- changedBy: entry(
- interaction.user.id,
- renderUser(interaction.user)
- ),
+ memberId: entry(interaction.user.id, `\`${interaction.user.id}\``),
+ changedBy: entry(interaction.user.id, renderUser(interaction.user)),
channel: entry(channel.id, renderChannel(channel))
},
hidden: {
@@ -115,9 +96,7 @@
embeds: [
new EmojiEmbed()
.setTitle("Staff Notifications Channel")
- .setDescription(
- "Something went wrong and the staff notifications channel could not be set"
- )
+ .setDescription("Something went wrong and the staff notifications channel could not be set")
.setStatus("Danger")
.setEmoji("CHANNEL.TEXT.DELETE")
],
@@ -157,15 +136,8 @@
new MessageActionRow().addComponents([
new MessageButton()
.setCustomId("clear")
- .setLabel(
- clicks ? "Click again to confirm" : "Reset channel"
- )
- .setEmoji(
- getEmojiByName(
- clicks ? "TICKETS.ISSUE" : "CONTROL.CROSS",
- "id"
- )
- )
+ .setLabel(clicks ? "Click again to confirm" : "Reset channel")
+ .setEmoji(getEmojiByName(clicks ? "TICKETS.ISSUE" : "CONTROL.CROSS", "id"))
.setStyle("DANGER")
.setDisabled(!channel)
])
@@ -182,9 +154,7 @@
clicks += 1;
if (clicks === 2) {
clicks = 0;
- await client.database.guilds.write(interaction.guild.id, null, [
- "logging.staff.channel"
- ]);
+ await client.database.guilds.write(interaction.guild.id, null, ["logging.staff.channel"]);
channel = undefined;
}
} else {
@@ -217,10 +187,7 @@
});
};
-const check = (
- interaction: CommandInteraction,
- _defaultCheck: WrappedCheck
-) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw "You must have the *Manage Server* permission to use this command";