From b71f9bf1d81ab9879dc6271a3285580279d3718d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 00:24:15 -0400 Subject: [PATCH] feat: added logging embeds --- shortmute/shortmute.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shortmute/shortmute.py b/shortmute/shortmute.py index 0802c75..e2028d8 100644 --- a/shortmute/shortmute.py +++ b/shortmute/shortmute.py @@ -101,6 +101,14 @@ class Shortmute(commands.Cog): await target.send(embed=dm_embed) except discord.HTTPException as error: await old_message.edit(content="Could not message the target, user most likely has Direct Messages disabled.") + logging_channels_list = await self.config.guild(old_interaction.guild.id).logging_channels() + if logging_channels_list: + logging_embed = discord.Embed(title="Shortmute", description=f"Moderator: {old_interaction.user.mention} ({old_interaction.user.id})\nTarget: {target.mention} ({target.id})\nDuration: `{readable_duration}`\nReason: `{reason}`", color=await self.bot.get_embed_color(None)) + if evidence: + logging_embed.set_image(evidence) + for channel_id in logging_channels_list: + channel_obj = old_interaction.guild.get_channel(channel_id) + await channel_obj.send(embed=logging_embed) @ui.button(label="No", style=discord.ButtonStyle.danger) async def shortmute_button_no(self, button: ui.Button, interaction: discord.Interaction):