discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.94k stars 1.26k forks source link

Unable to embed links of my website #4275

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi, if I post a link of my website in Discord, it doesn't load the embedd (it works correctly with on other platforms). It doesn't embed any of the links of my website https://wyld.moe or https://elry.moe What could be the problem? All the options to embed links are enabled in Discord and the website metatags are correctly set with Open Graph.

InvalidLenni commented 2 years ago

Are you sure that the metatags corretly set?

ghost commented 2 years ago

Are you sure that the metatags corretly set?

Yes, due to them working on whatsapp. image image

InvalidLenni commented 2 years ago

this is probably due to your website btw, your meta tags must look something like this

  <meta content="Title" property="og:title" />
  <meta content="Description" property="og:description" />
  <meta content="Title URL" property="og:url" />
  <meta content="Icon path" property="og:image" />
ghost commented 2 years ago

Buddy, they work on Whatsapp; they are all set.

<meta name="description" content="Gather Resources, Fight Wildlife and build a Home."> <meta name="keywords" content="game, landing page, gaming, business, wild, wyld, steam"> <meta property="og:site_name" content="WYLD" /> <meta property="og:site" content="https://wyld.moe" /> <meta property="og:description" content="WYLD, its You vs the Wild. Gather Resources, Fight Wildlife and build a Home." /> <meta property="og:image" content="https://wyld.moe/images/headline.png" />

ghost commented 2 years ago

So idk whats happening, but from me everything is set correctly.

InvalidLenni commented 2 years ago

Can you try my code?

Btw, whatsapp is not discord.

ghost commented 2 years ago

Im litterally using the same code, just not Title, but Site_name, which looks better imo. My other website has the Title tag and is not behaving any differently.

ghost commented 2 years ago

I replaced, Site_Name with Title, and nothing has changed. Now its exactly like you described.

InvalidLenni commented 2 years ago

https://stackoverflow.com/questions/54266598/meta-tags-for-url-with-description-and-image-in-skype-discord

ghost commented 2 years ago

https://stackoverflow.com/questions/54266598/meta-tags-for-url-with-description-and-image-in-skype-discord

All of the named og tags are properly set on both of my websites.

Zoddo commented 2 years ago

night listed a few cases that can make the embedding fail: https://github.com/discord/discord-api-docs/issues/4146#issuecomment-983105972

Notably, he linked https://ogp.me/ which says that 4 properties are required. None of your websites includes all required properties. I would first try to include all these properties.

Also, Discord can cache an old version of your OG tags. So when testing, be sure to include something like ?test=<random value> at the end of your URL to force Discord to fetch the updated page.

ghost commented 2 years ago

None of your websites includes all required properties. I would first try to include all these properties.

image

image

Zoddo commented 2 years ago

When I posted my comment, the og:type wasn't set on any of your websites.

Do you have access to the logs of the webserver? If so, do you see a request coming from Discord when posting the link in a message? (the user agent will contain Discordbot/2.0 iirc).

ghost commented 2 years ago

There is no Discordbot/2.0

drunderscore commented 2 years ago

Embed works properly, see below. Screenshot from 2021-12-25 22-09-09

Mineinjava commented 2 years ago

do you have the embed links permission?

I CNR.

SinisterRectus commented 2 years ago

For future visitors, what did you do to fix this? Was it the missing type tag?

ghost commented 2 years ago

For future visitors, what did you do to fix this? Was it the missing type tag?

Contact your Hoster, mine blocked discords api bot.