feat: added logging embeds
This commit is contained in:
parent
00dc0211c3
commit
b71f9bf1d8
1 changed files with 8 additions and 0 deletions
|
@ -101,6 +101,14 @@ class Shortmute(commands.Cog):
|
||||||
await target.send(embed=dm_embed)
|
await target.send(embed=dm_embed)
|
||||||
except discord.HTTPException as error:
|
except discord.HTTPException as error:
|
||||||
await old_message.edit(content="Could not message the target, user most likely has Direct Messages disabled.")
|
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)
|
@ui.button(label="No", style=discord.ButtonStyle.danger)
|
||||||
async def shortmute_button_no(self, button: ui.Button, interaction: discord.Interaction):
|
async def shortmute_button_no(self, button: ui.Button, interaction: discord.Interaction):
|
||||||
|
|
Loading…
Reference in a new issue