lunarflu HF Staff commited on
Commit
501296f
·
verified ·
1 Parent(s): aa031d0

make consistent with how we embed delete_messages

Browse files
Files changed (1) hide show
  1. app.py +15 -17
app.py CHANGED
@@ -82,24 +82,21 @@ async def on_message(message):
82
 
83
 
84
  """Backup"""
85
-
86
- embed = discord.Embed(
87
- title=f"Messages since last restart #{number_of_messages}",
88
- color=discord.Color.blue()
89
- )
90
- embed.add_field(name="Channel", value=message.channel, inline=False)
91
- embed.add_field(name="Message link", value=message.jump_url, inline=False)
92
- embed.add_field(name="Author", value=f"{message.author} (`{message.author.id}`)", inline=False)
93
-
94
- # Use .content directly (no ping)
95
- if message.content:
96
- embed.add_field(name="Content", value=discord.utils.escape_markdown(message.content) or "*No text*", inline=False)
97
-
98
- # Attachments
99
  if message.attachments:
100
- for attachment in message.attachments:
101
- embed.add_field(name="Attachment", value=attachment.url, inline=False)
102
-
 
103
  # Embeds
104
  if message.embeds:
105
  for i, embedded in enumerate(message.embeds):
@@ -115,6 +112,7 @@ async def on_message(message):
115
 
116
 
117
 
 
118
 
119
 
120
 
 
82
 
83
 
84
  """Backup"""
85
+
86
+ embed = Embed(color=Color.blue())
87
+ embed.set_author(name=f"{message.author} ID: {message.author.id}", icon_url=message.author.avatar.url if message.author.avatar else bot.user.avatar.url)
88
+ embed.title = f"Message Posted"
89
+ embed.description = message.content or "*(empty message)*"
90
+ embed.add_field(name="Author Username", value=message.author.name, inline=True)
91
+ embed.add_field(name="Channel", value=message.channel.mention, inline=True)
92
+ embed.add_field(name="Message Created On", value=convert_to_timezone(message.created_at, zurich_tz), inline=True)
93
+ embed.add_field(name="Message ID", value=message.id, inline=True)
94
+ embed.add_field(name="Message Jump URL", value=f"[Jump to message!](https://discord.com/channels/{message.guild.id}/{message.channel.id}/{message.id})", inline=True)
 
 
 
 
95
  if message.attachments:
96
+ attachment_urls = "\n".join([attachment.url for attachment in message.attachments])
97
+ embed.add_field(name="Attachments", value=attachment_urls, inline=False)
98
+ embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
99
+
100
  # Embeds
101
  if message.embeds:
102
  for i, embedded in enumerate(message.embeds):
 
112
 
113
 
114
 
115
+
116
 
117
 
118