MadelineProto/docs/TD_docs/constructors/webPage.md

2.7 KiB

title description
webPage Describes web page preview

Constructor: webPage

Back to constructors index

Describes web page preview

Attributes:

Name Type Required Description
url string Yes Original URL of link
display_url string Yes URL to display
type string Yes Type of web page: article, photo, audio, video, document, profile, app or something other
site_name string Yes Short name of the site (i.e. Google Docs or App Store)
title string Yes Title of the content
description string Yes Description of the content
photo photo Yes Image representing the content, nullable
embed_url string Yes Url to show embedded preview
embed_type string Yes MIME type of embedded preview, i.e. text/html or video/mp4
embed_width int Yes Width of embedded preview
embed_height int Yes Height of embedded preview
duration int Yes Duration of the content
author string Yes Author of the content
animation animation Yes Preview as Animation if available, nullable
audio audio Yes Preview as Audio if available, nullable
document document Yes Preview as Document if available (currently only for small pdf files and zip archives), nullable
sticker sticker Yes Preview as Sticker for small .webp files if available, nullable
video video Yes Preview as Video if available, nullable
voice voice Yes Preview as Voice if available, nullable

Type: WebPage

Example:

$webPage = ['_' => 'webPage', 'url' => string, 'display_url' => string, 'type' => string, 'site_name' => string, 'title' => string, 'description' => string, 'photo' => photo, 'embed_url' => string, 'embed_type' => string, 'embed_width' => int, 'embed_height' => int, 'duration' => int, 'author' => string, 'animation' => animation, 'audio' => audio, 'document' => document, 'sticker' => sticker, 'video' => video, 'voice' => voice, ];

Or, if you're into Lua:

webPage={_='webPage', url=string, display_url=string, type=string, site_name=string, title=string, description=string, photo=photo, embed_url=string, embed_type=string, embed_width=int, embed_height=int, duration=int, author=string, animation=animation, audio=audio, document=document, sticker=sticker, video=video, voice=voice, }