InputRichMessageMedia¶
- class pyrogram.types.InputRichMessageMedia[source]¶
Describes media referenced in a rich message.
There are two ways a rich message refers to media, and this object covers both.
By identifier, for html and markdown content: set id and media, and refer to it from the text as
tg://photo?id=<id>,tg://video?id=<id>ortg://audio?id=<id>.By position, for blocks content: set photos, documents and users, which the block objects index into (the
photo_idof anInputRichBlockPhotomust match theidattribute of the correspondingInputPhoto). MTProto has no identifiers on this side, which is why the two shapes differ.- Parameters:
id (
str, optional) – Unique identifier of the media used in atg://photo?id=,tg://video?id=ortg://audio?id=link. 1-64 characters, onlyA-Z,a-z,0-9,_and-are allowed.media (
str|InputPhoto|InputDocument, optional) – The media the identifier refers to, as a file identifier of an already uploaded file or as an input photo or document. A rich message can only refer to media that already exists on Telegram, so a local path or an HTTP URL has to be uploaded first.photos (List of
InputPhoto, optional) – Photos referenced by blocks.documents (List of
InputDocument, optional) – Documents referenced by blocks.users (List of
InputUser, optional) – Users referenced by blocks.