fix: fixed how passed_info works

This commit is contained in:
Seaswimmer 2023-08-08 02:05:37 -04:00
parent 45c64a77e5
commit 242840719c
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -37,13 +37,6 @@ class Shortmute(commands.Cog):
""" """
disable_dateutil() disable_dateutil()
timedelta = parse(f'{duration} minutes', as_timedelta=True) 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: 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) 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 return
@ -53,6 +46,14 @@ class Shortmute(commands.Cog):
evidence = str(evidence_image) evidence = str(evidence_image)
else: else:
evidence = None 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() immune_roles_list = await self.config.guild(interaction.guild).immune_roles()
for role_id in immune_roles_list: for role_id in immune_roles_list:
role = interaction.guild.get_role(role_id) role = interaction.guild.get_role(role_id)
@ -80,9 +81,6 @@ class Shortmute(commands.Cog):
embed.set_footer(text="/shortmute") embed.set_footer(text="/shortmute")
if evidence: if evidence:
embed.set_image(url=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) await interaction.response.send_message(embed=embed, view=self.ShortmuteButtons(timeout=180, passed_info=passed_info), ephemeral=True)
elif skip_confirmation is 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)) 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))