diff options
| author | 2021-04-21 15:09:29 +0530 | |
|---|---|---|
| committer | 2021-10-11 12:05:37 +0530 | |
| commit | b116d3c47d9c5c8e99b2557b37d0e402652b5ef3 (patch) | |
| tree | 584bbbc6fd1016440c18e96888fa6baed0da64d2 | |
| parent | Bug fixes (diff) | |
Rework message link embed.
- Instead of default black colour, use gold to give it some shine!
- Mention the channel also in the channel field.
- Add message ID in footer, so it is easy to figure out for which message link is that embed.
| -rw-r--r-- | bot/exts/moderation/incidents.py | 16 | 
1 files changed, 9 insertions, 7 deletions
| diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py index 413c9bcf9..aebf22d00 100644 --- a/bot/exts/moderation/incidents.py +++ b/bot/exts/moderation/incidents.py @@ -149,8 +149,6 @@ async def make_message_link_embed(ctx: Context, message_link: str) -> t.Optional          Channel: Special/#bot-commands (814190307980607493)          Content: This is a very important message!      """ -    embed = discord.Embed() -      try:          message_convert_object = MessageConverter()          message = await message_convert_object.convert(ctx, message_link) @@ -162,12 +160,16 @@ async def make_message_link_embed(ctx: Context, message_link: str) -> t.Optional          text = message.content          channel = message.channel -        embed.description = ( -            f"**Author:** {format_user(message.author)}\n" -            f"**Channel:** {channel.category}/#{channel.name} (`{channel.id}`)\n" -            f"**Content:** {textwrap.shorten(text, 300, placeholder='...')}\n" -            "\n" +        embed = discord.Embed( +            colour=discord.Colour.gold(), +            description=( +                f"**Author:** {format_user(message.author)}\n" +                f"**Channel:** <#{channel.id}> ({channel.category}/#{channel.name})\n" +                f"**Content:** {textwrap.shorten(text, 300, placeholder='...')}\n" +            )          ) +        embed.set_footer(text=f"Message ID: {message.id}") +          return embed | 
