Bug fixes and ~~performance~~ typing improvements
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index fd64424..21437b2 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.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";
@@ -23,9 +19,7 @@
.addChannelTypes([ChannelType.GuildNews, ChannelType.GuildText])
);
-const callback = async (
- interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const m = (await interaction.reply({
embeds: LoadingEmbed,
ephemeral: true,
@@ -41,9 +35,7 @@
new EmojiEmbed()
.setEmoji("CHANNEL.TEXT.DELETE")
.setTitle("Log Channel")
- .setDescription(
- "The channel you provided is not a valid channel"
- )
+ .setDescription("The channel you provided is not a valid channel")
.setStatus("Danger")
]
});
@@ -54,9 +46,7 @@
embeds: [
new EmojiEmbed()
.setTitle("Log 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")
]
@@ -65,9 +55,7 @@
const confirmation = await new confirmationMessage(interaction)
.setEmoji("CHANNEL.TEXT.EDIT")
.setTitle("Log Channel")
- .setDescription(
- `Are you sure you want to set the log channel to <#${channel.id}>?`
- )
+ .setDescription(`Are you sure you want to set the log channel to <#${channel.id}>?`)
.setColor("Warning")
.setInverted(true)
.send(true);
@@ -77,8 +65,7 @@
await client.database.guilds.write(interaction.guild.id, {
"logging.logs.channel": channel.id
});
- const { log, NucleusColors, entry, renderUser, renderChannel } =
- client.logger;
+ const { log, NucleusColors, entry, renderUser, renderChannel } = client.logger;
const data = {
meta: {
type: "logChannelUpdate",
@@ -89,14 +76,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: {
@@ -110,9 +91,7 @@
embeds: [
new EmojiEmbed()
.setTitle("Log Channel")
- .setDescription(
- "Something went wrong and the log channel could not be set"
- )
+ .setDescription("Something went wrong and the log channel could not be set")
.setStatus("Danger")
.setEmoji("CHANNEL.TEXT.DELETE")
],
@@ -152,15 +131,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)
])
@@ -177,9 +149,7 @@
clicks += 1;
if (clicks === 2) {
clicks = 0;
- await client.database.guilds.write(interaction.guild.id, null, [
- "logging.logs.channel"
- ]);
+ await client.database.guilds.write(interaction.guild.id, null, ["logging.logs.channel"]);
channel = undefined;
}
} else {
@@ -212,10 +182,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";