From 242840719cc50b0abf2023bcdaffaee3e20fffa7 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 02:05:37 -0400 Subject: [PATCH] fix: fixed how passed_info works --- shortmute/shortmute.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/shortmute/shortmute.py b/shortmute/shortmute.py index b734f1b..31c92f5 100644 --- a/shortmute/shortmute.py +++ b/shortmute/shortmute.py @@ -37,13 +37,6 @@ class Shortmute(commands.Cog): """ disable_dateutil() timedelta = parse(f'{duration} minutes', as_timedelta=True) - passed_info = { - "target": target, - "timedelta": timedelta, - "reason": reason, - "interaction": interaction, - "color": await self.bot.get_embed_color(None) - } if evidence_image and evidence_link: await interaction.response.send_message(content="You've provided both the `evidence_image` and the `evidence_link` arguments! Please only use one or the other.", ephemeral=True) return @@ -53,6 +46,14 @@ class Shortmute(commands.Cog): evidence = str(evidence_image) else: evidence = None + passed_info = { + "target": target, + "timedelta": timedelta, + "reason": reason, + "interaction": interaction, + "color": await self.bot.get_embed_color(None), + "evidence": evidence + } immune_roles_list = await self.config.guild(interaction.guild).immune_roles() for role_id in immune_roles_list: role = interaction.guild.get_role(role_id) @@ -80,9 +81,6 @@ class Shortmute(commands.Cog): embed.set_footer(text="/shortmute") if evidence: embed.set_image(url=evidence) - passed_info.update({ - "evidence": evidence - }) await interaction.response.send_message(embed=embed, view=self.ShortmuteButtons(timeout=180, passed_info=passed_info), ephemeral=True) elif skip_confirmation is True: edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"**Moderator:** {interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=await self.bot.get_embed_color(None))