lunarflu HF Staff commited on
Commit
1a91456
·
verified ·
1 Parent(s): bf66947

test embeds

Browse files
Files changed (1) hide show
  1. app.py +11 -21
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
- if message.attachments:
97
- attachment_urls = "\n".join([attachment.url for attachment in message.attachments])
98
- embed.add_field(name="Attachments", value=attachment_urls, inline=False)
99
-
100
- for attachment in message.attachments:
101
- if (
102
- not attachment.filename.startswith("SPOILER_")
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