From 45c64a77e5977b0ea01560ef92101b09979ca24f Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 02:03:44 -0400 Subject: [PATCH] fix: fixed evidence checking in shortmute button --- shortmute/shortmute.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shortmute/shortmute.py b/shortmute/shortmute.py index 8e05ac9..b734f1b 100644 --- a/shortmute/shortmute.py +++ b/shortmute/shortmute.py @@ -39,7 +39,6 @@ class Shortmute(commands.Cog): timedelta = parse(f'{duration} minutes', as_timedelta=True) passed_info = { "target": target, - "duration": duration, "timedelta": timedelta, "reason": reason, "interaction": interaction, @@ -123,15 +122,14 @@ class Shortmute(commands.Cog): async def shortmute_button_yes(self, button: ui.Button, interaction: discord.Interaction): disable_dateutil() target = self.passed_info['target'] - duration = self.passed_info['duration'] readable_duration = self.passed_info['readable_duration'] reason = self.passed_info['reason'] old_interaction = self.passed_info['interaction'] color = self.passed_info['color'] timedelta = self.passed_info['timedelta'] + 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 self.passed_info.get('evidence'): - evidence = self.passed_info['evidence'] + if evidence: edit_embed.set_image(url=evidence) 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}")