feat: use deferReply in bug/report.ts
willow hai@wlo.moe
Thu, 05 Jun 2025 22:58:06 +0100
1 files changed,
7 insertions(+),
11 deletions(-)
M
src/interactions/commands/bug/report.ts
→
src/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"], }); } }