i have not committed in years
diff --git a/src/commands/mod/unmute.ts b/src/commands/mod/unmute.ts
index 2c522a4..65e5e97 100644
--- a/src/commands/mod/unmute.ts
+++ b/src/commands/mod/unmute.ts
@@ -2,7 +2,7 @@
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
-import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -17,7 +17,7 @@
const callback = async (interaction: CommandInteraction) => {
// TODO:[Modals] Replace this with a modal
- if (await new confirmationMessage(interaction)
+ let confirmation = await new confirmationMessage(interaction)
.setEmoji("PUNISH.MUTE.RED")
.setTitle("Unmute")
.setDescription(keyValueList({
@@ -29,13 +29,14 @@
.setColor("Danger")
// pluralize("day", interaction.options.getInteger("delete"))
// const pluralize = (word: string, count: number) => { return count === 1 ? word : word + "s" }
- .send()) {
+ .send()
+ if (confirmation.success) {
let dmd = false
let dm;
try {
if (interaction.options.getString("notify") != "no") {
dm = await (interaction.options.getMember("user") as GuildMember).send({
- embeds: [new EmojiEmbed()
+ embeds: [new generateEmojiEmbed()
.setEmoji("PUNISH.MUTE.GREEN")
.setTitle("Unmuted")
.setDescription(`You have been unmuted in ${interaction.guild.name}` +
@@ -49,7 +50,7 @@
try {
(interaction.options.getMember("user") as GuildMember).timeout(0, interaction.options.getString("reason") || "No reason provided")
} catch {
- await interaction.editReply({embeds: [new EmojiEmbed()
+ await interaction.editReply({embeds: [new generateEmojiEmbed()
.setEmoji("PUNISH.MUTE.RED")
.setTitle(`Unmute`)
.setDescription("Something went wrong and the user was not unmuted")
@@ -59,14 +60,14 @@
return
}
let failed = (dmd == false && interaction.options.getString("notify") != "no")
- await interaction.editReply({embeds: [new EmojiEmbed()
+ await interaction.editReply({embeds: [new generateEmojiEmbed()
.setEmoji(`PUNISH.MUTE.${failed ? "YELLOW" : "GREEN"}`)
.setTitle(`Unmute`)
.setDescription("The member was unmuted" + (failed ? ", but could not be notified" : ""))
.setStatus(failed ? "Warning" : "Success")
], components: []})
} else {
- await interaction.editReply({embeds: [new EmojiEmbed()
+ await interaction.editReply({embeds: [new generateEmojiEmbed()
.setEmoji("PUNISH.MUTE.GREEN")
.setTitle(`Unmute`)
.setDescription("No changes were made")