From 5872c6f2bdb2075e0f3453cb36f0fdffcb485e02 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Fri, 26 Apr 2024 21:42:23 +0500 Subject: [PATCH] move channel archivation --- commands/Fun/number.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/Fun/number.js b/commands/Fun/number.js index 4cdc2785..c4fbca60 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -109,8 +109,6 @@ class Number extends BaseCommand { }), }); - channel.setArchived(true); - const deleteYes = new ButtonBuilder() .setCustomId("number_delete_yes") .setLabel(interaction.translate("common:YES")) @@ -141,6 +139,7 @@ class Number extends BaseCommand { collector.on("end", (_, reason) => { delete currentGames[interaction.guildId]; + if (reason === "time") return interaction.editReply({ content: interaction.translate("fun/number:DEFEAT", { number }) }); else if (reason === "force") return interaction.editReply({ content: interaction.translate("misc:FORCE_STOP", { user: interaction.member.toString(), number }) }); }); @@ -158,8 +157,10 @@ class Number extends BaseCommand { if (interaction.customId === "number_delete_yes") interaction.channel.delete(); - else if (interaction.customId === "number_delete_no") - interaction.message.delete(); + else if (interaction.customId === "number_delete_no") { + await interaction.message.delete(); + interaction.channel.setArchived(true); + } }); } }