Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
test embeds
Browse files
app.py
CHANGED
@@ -93,33 +93,23 @@ async def on_message(message):
|
|
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 |
# Handle attachments
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
and attachment.url.lower().endswith((".png", ".jpg", ".jpeg", ".gif", ".webp"))
|
104 |
-
):
|
105 |
-
embed.set_image(url=attachment.url)
|
106 |
-
break # Only one image can be embedded inline
|
107 |
-
|
108 |
-
# Handle embeds within message (e.g. link previews)
|
109 |
-
if message.embeds:
|
110 |
-
for i, embedded in enumerate(message.embeds):
|
111 |
-
if embedded.title or embedded.description:
|
112 |
-
embed.add_field(
|
113 |
-
name=f"Embed {i + 1}",
|
114 |
-
value=f"**{embedded.title or ''}**\n{embedded.description or ''}",
|
115 |
-
inline=False
|
116 |
-
)
|
117 |
|
118 |
#await bot.log_channel.send(embed=embed)
|
119 |
dm_message = await lunarflu.send(embed=embed)
|
120 |
|
121 |
|
122 |
|
|
|
|
|
|
|
|
|
123 |
|
124 |
|
125 |
|
|
|
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 |
# Handle attachments
|
96 |
+
# test
|
97 |
+
embed = discord.Embed(title="🖼 Full Image Test", color=discord.Color.green())
|
98 |
+
|
99 |
+
for attachment in message.attachments:
|
100 |
+
if not attachment.filename.startswith("SPOILER_") and attachment.content_type and attachment.content_type.startswith("image/"):
|
101 |
+
embed.set_image(url=attachment.url)
|
102 |
+
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
#await bot.log_channel.send(embed=embed)
|
105 |
dm_message = await lunarflu.send(embed=embed)
|
106 |
|
107 |
|
108 |
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
|
114 |
|
115 |
|