From 4d321006c89f740b59c46e5c5b8d47fa4b9fb1ab Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 2 Feb 2024 11:47:51 -0500 Subject: [PATCH] fix(aurora): defer the interaction so it doesn't expire --- aurora/aurora.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index df3b561..5bc3911 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -379,11 +379,12 @@ class Aurora(commands.Cog): except discord.errors.HTTPException: pass + await interaction.response.defer() await target.add_roles( role, reason=f"Role added by {interaction.user.id}{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')} for: {reason}", ) - await interaction.response.send_message( + response: discord.WebhookMessage = await interaction.followup.send( content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')}!\n**Reason** - `{reason}`" ) @@ -397,8 +398,8 @@ class Aurora(commands.Cog): duration, reason, ) - await interaction.edit_original_response( - content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`" + await response.edit( + content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`", ) await log(interaction, moderation_id)