From 296af431f0a32ed7160c042dc2ae064c8856e29f Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 20 Nov 2023 12:38:42 +0100 Subject: [PATCH] Fixed remove command --- commands/remove.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/commands/remove.js b/commands/remove.js index 56bc671..6e72ac6 100644 --- a/commands/remove.js +++ b/commands/remove.js @@ -28,15 +28,18 @@ module.exports = { /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { + + interaction.deferReply() + const user = interaction.options.getUser('user'); - const reason = interaction.options.getString('reason') || "No reason provided." + const reason = interaction.options.getString('reason') ?? "No reason provided." const mod = interaction.user - const color = Number(color.replace('#', '0x')) + const embedColor = Number(color.replace('#', '0x')) const waitinglist = await waitinglistSchema.findOne({ UserID: user.id }) if (!waitinglist) { - await interaction.reply({ + await interaction.editReply({ embeds: [{ description: userMention(user.id) + " is not on the waiting list.", color: color @@ -47,10 +50,12 @@ module.exports = { await waitinglistSchema.findOneAndDelete({ UserID: user.id }) - await interaction.reply({ + await interaction.editReply({ embeds: [{ - description: userMention(user.id) + " has been removed from the waiting list.", - color: color + description: userMention(user.id) + " has been removed from the waiting list.\n" + + "**Reason:** `" + reason + "`\n" + + "**Moderator:** " + userMention(mod.id), + color: embedColor, }] }) }