1

I've got an embed structured exactly how I want - the only problem is the URL isn't being expanded automatically by Discord, like it does for URLs sent in normal messages.

e.g. This is the embed I've created:

enter image description here

This is the code for the embed:

embed=Embed(title=f'{rss_item[1]}', description=f'**Date:** {date_activity}\n**Title:** {rss_object.title}\n**Read more:** {rss_object.link}' color=0x04bd23)
embed.set_author(name="Private Sector Feed", icon_url="https://cdn-icons-png.flaticon.com/512/700/700652.png")
private_sector_feed.send(embed=embed)

As you can see, the URL isn't enriched by Discord. When sent as a normal message object, it does get expanded:

enter image description here

All I want is for the link enrichment to occur for the embed URL - do you know if there's a way to make that work?

Alternatively, is there a better way to format the plain message? The best I can see to do is bold some text, but other than that it's just a wall of text separated by the enriched links, which doesn't look good:

enter image description here

enter image description here

Faraday
  • 31
  • 2
  • The links only get auto-embeds if they're in the "normal content" part of the message. You can still post them at the top and have them display though, or you can add a second embed with the info manually. – Eric Jin Aug 31 '22 at 00:58

1 Answers1

0

The link must be in the content part of the message to show the link preview.

If you manually fetch the metadata for the link, you can add a custom second embed with the image and link and everything.

See also: Get meta tag content property with BeautifulSoup and Python

Otherwise, you can either just put the link in the content also, or use the "spoiler spam" hack to make the link invisible This still works on Discord desktop. Note that on mobile, it will show the link, and this may be patched on Desktop in the future.

||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​|| https://google.com

enter image description here

DenverCoder1
  • 2,253
  • 1
  • 10
  • 23