Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
make consistent with how we embed delete_messages
Browse files
app.py
CHANGED
@@ -82,24 +82,21 @@ async def on_message(message):
|
|
82 |
|
83 |
|
84 |
"""Backup"""
|
85 |
-
|
86 |
-
embed =
|
87 |
-
|
88 |
-
|
89 |
-
)
|
90 |
-
embed.add_field(name="
|
91 |
-
embed.add_field(name="
|
92 |
-
embed.add_field(name="
|
93 |
-
|
94 |
-
|
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 |
-
|
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 |
|