all repos — stealth-developers @ 2b8e1cb8074eaf0e6088ab69e8de711b416bb7ef

feat: use deferReply in bug/report.ts
willow hai@wlo.moe
Thu, 05 Jun 2025 22:58:06 +0100
commit

2b8e1cb8074eaf0e6088ab69e8de711b416bb7ef

parent

9e70b9738062e72ae29c11654064b6f755567753

1 files changed, 7 insertions(+), 11 deletions(-)

jump to
M src/interactions/commands/bug/report.tssrc/interactions/commands/bug/report.ts

@@ -88,6 +88,7 @@

const customIdParts = interaction.customId.split(":"); const title = interaction.fields.getTextInputValue("title"); const description = interaction.fields.getTextInputValue("description"); + await interaction.deferReply({ flags: ["Ephemeral"] }); // handle edit case if (customIdParts[1] === "edit") {

@@ -96,9 +97,8 @@

try { const bug = await BugModel.findOne({ bug_id: bugId }); if (!bug) { - await interaction.reply({ + await interaction.editReply({ content: "❌ bug not found.", - flags: ["Ephemeral"], }); return; }

@@ -116,15 +116,13 @@ await updateBugEmbed(client, bug, bug.message_id, guild.bug_channel);

} } - await interaction.reply({ + await interaction.editReply({ content: `✅ bug #${bug.bug_id} updated!`, - flags: ["Ephemeral"], }); } catch (error) { logger.error("failed to update bug:", error); - await interaction.reply({ + await interaction.editReply({ content: "❌ failed to update bug. please try again later.", - flags: ["Ephemeral"], }); } return;

@@ -160,7 +158,7 @@ if (guild?.bug_channel) {

try { const channel = await client.channels.fetch(guild.bug_channel); if (channel?.type !== ChannelType.GuildText) { - await interaction.reply({ + await interaction.editReply({ content: "❌ the bug channel is misconfigured", }); }

@@ -257,15 +255,13 @@ logger.error(`failed to send bug report to channel: ${error}`);

} } - await interaction.reply({ + await interaction.editReply({ content: `✅ bug report submitted! ${msgUrl}`, - flags: ["Ephemeral"], }); } catch (error) { logger.error("failed to create bug report:", error); - await interaction.reply({ + await interaction.editReply({ content: "❌ failed to submit bug report. please try again later.", - flags: ["Ephemeral"], }); } }