feat: added logging embeds

This commit is contained in:
Seaswimmer 2023-08-08 00:24:15 -04:00
parent 00dc0211c3
commit b71f9bf1d8
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

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