fix(aurora): defer the interaction so it doesn't expire
All checks were successful
Actions / Lint Code (Pylint) (push) Successful in 30s
Actions / Build Documentation (MkDocs) (push) Successful in 13s

This commit is contained in:
Seaswimmer 2024-02-02 11:47:51 -05:00
parent d1afd62114
commit 4d321006c8
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -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)