How does telegram shows the Icon of some websites?

2019-03-17 13:58发布

问题:

I am working with telegram on windows and its online version on web.telegram.org, when I share a link with my friend Telegram shows the icon or logo of some websites in that message:

Image

The first website is vajehyab.com and it has a favicon too (But do not showing that website icon), and the second is Stackoverflow and as you see the logo of stackoverflow and a litle description shows beside it.

Does websites do something or having some metadata that allow Telegram to access their logo, or it is an static program form Telegram programmers and the set some famous websites logo?

回答1:

Just add these tags to your website

<meta property="og:title" content="Title" />
<meta property="og:site_name" content="Site name"/>
<meta property="og:description" content="Description" />
<meta property="og:image" content="Link to your logo" />


回答2:

As well as adding what @Manikiran proposed you need to add this

<html prefix="og: http://ogp.me/ns#">

and use telegrams @WebpageBot afterwards