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):