diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..da5b77c4 Binary files /dev/null and b/.DS_Store differ diff --git a/report/report.py b/report/report.py index fae571cc..3f2a769e 100644 --- a/report/report.py +++ b/report/report.py @@ -315,6 +315,10 @@ async def do_report( report_type = "emergency" if emergency else "regular" logger.debug(f"Processing {report_type} report from {message.author.name} ({message.author.id})") + # Acknowledge the interaction immediately to avoid Discord's 3-second timeout + if interaction is not None and not interaction.response.is_done(): + await interaction.response.defer(ephemeral=True) + # Pre-emptively delete the message for privacy reasons if interaction is None: logger.debug("Deleting original report message for privacy") @@ -350,9 +354,9 @@ async def do_report( report_reply = self.make_reporter_reply(channel.guild, channel, report_body, emergency) # Send interaction response if this is a slash command - if interaction is not None and not interaction.response.is_done(): - logger.debug("Sending confirmation via interaction response") - await interaction.response.send_message(embed=report_reply, ephemeral=True) + if interaction is not None: + logger.debug("Sending confirmation via interaction followup") + await interaction.followup.send(embed=report_reply, ephemeral=True) # Else send a DM if DM confirmations are enabled elif await self.config.guild(channel.guild).confirmations(): @@ -409,7 +413,7 @@ async def notify_truncation( f"⚠️ Your report was truncated from {original_length} to {truncated_length} characters " f"due to Discord's limits. The report was still sent successfully." ) - if interaction is not None and not interaction.response.is_done(): + if interaction is not None: await interaction.followup.send(truncation_msg, ephemeral=True) logger.debug("Truncation notification sent via interaction followup message") else: