fix: fixed evidence checking in shortmute button
This commit is contained in:
parent
f862affafc
commit
45c64a77e5
1 changed files with 2 additions and 4 deletions
|
@ -39,7 +39,6 @@ class Shortmute(commands.Cog):
|
||||||
timedelta = parse(f'{duration} minutes', as_timedelta=True)
|
timedelta = parse(f'{duration} minutes', as_timedelta=True)
|
||||||
passed_info = {
|
passed_info = {
|
||||||
"target": target,
|
"target": target,
|
||||||
"duration": duration,
|
|
||||||
"timedelta": timedelta,
|
"timedelta": timedelta,
|
||||||
"reason": reason,
|
"reason": reason,
|
||||||
"interaction": interaction,
|
"interaction": interaction,
|
||||||
|
@ -123,15 +122,14 @@ class Shortmute(commands.Cog):
|
||||||
async def shortmute_button_yes(self, button: ui.Button, interaction: discord.Interaction):
|
async def shortmute_button_yes(self, button: ui.Button, interaction: discord.Interaction):
|
||||||
disable_dateutil()
|
disable_dateutil()
|
||||||
target = self.passed_info['target']
|
target = self.passed_info['target']
|
||||||
duration = self.passed_info['duration']
|
|
||||||
readable_duration = self.passed_info['readable_duration']
|
readable_duration = self.passed_info['readable_duration']
|
||||||
reason = self.passed_info['reason']
|
reason = self.passed_info['reason']
|
||||||
old_interaction = self.passed_info['interaction']
|
old_interaction = self.passed_info['interaction']
|
||||||
color = self.passed_info['color']
|
color = self.passed_info['color']
|
||||||
timedelta = self.passed_info['timedelta']
|
timedelta = self.passed_info['timedelta']
|
||||||
edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"**Moderator:** {old_interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=color)
|
|
||||||
if self.passed_info.get('evidence'):
|
|
||||||
evidence = self.passed_info['evidence']
|
evidence = self.passed_info['evidence']
|
||||||
|
edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"**Moderator:** {old_interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=color)
|
||||||
|
if evidence:
|
||||||
edit_embed.set_image(url=evidence)
|
edit_embed.set_image(url=evidence)
|
||||||
old_message = await old_interaction.edit_original_response(embed=edit_embed, view=None)
|
old_message = await old_interaction.edit_original_response(embed=edit_embed, view=None)
|
||||||
await target.timeout(timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
|
await target.timeout(timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
|
||||||
|
|
Loading…
Reference in a new issue