Skip to content

Commit d363a18

Browse files
committed
Initial docs for WebPage
1 parent 9687ef2 commit d363a18

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

docs/source/api/types.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Messages & Media
5454
- :class:`Venue`
5555
- :class:`Sticker`
5656
- :class:`Game`
57+
- :class:`WebPage`
5758
- :class:`Poll`
5859
- :class:`PollOption`
5960

@@ -137,6 +138,7 @@ Details
137138
.. autoclass:: Venue()
138139
.. autoclass:: Sticker()
139140
.. autoclass:: Game()
141+
.. autoclass:: WebPage()
140142
.. autoclass:: Poll()
141143
.. autoclass:: PollOption()
142144

pyrogram/client/types/messages_and_media/message.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,8 @@ class Message(Object, Update):
177177
venue (:obj:`Venue`, *optional*):
178178
Message is a venue, information about the venue.
179179
180-
web_page (``bool``, *optional*):
180+
web_page (:obj:`WebPage`, *optional*):
181181
Message was sent with a webpage preview.
182-
**Note:** Support for web pages is still basic; a simple boolean is set in case the message contains a
183-
web page preview. In future versions this property could turn into a full web page object that contains
184-
more details.
185182
186183
poll (:obj:`Poll`, *optional*):
187184
Message is a native poll, information about the poll.

pyrogram/client/types/messages_and_media/webpage.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class WebPage(Object):
3636
Display URL for this webpage.
3737
3838
type (``str``, *optional*):
39-
Type of webpage, can be `article`, `photo`, `gif`, `video` or `document` afaik. #TODO
39+
Type of webpage preview, known types (at the time of writing) are `article`, `photo`, `gif`, `video` and `document`.
4040
4141
site_name (``str``, *optional*):
42-
Site name.
42+
Webpage site name.
4343
4444
title (``str``, *optional*):
4545
Title of this webpage.
@@ -48,25 +48,25 @@ class WebPage(Object):
4848
Description of this webpage.
4949
5050
audio (:obj:`Audio`, *optional*):
51-
Webpage is an audio file, information about the file.
51+
Webpage preview is an audio file, information about the file.
5252
5353
document (:obj:`Document`, *optional*):
54-
Webpage is a general file, information about the file.
54+
Webpage preview is a general file, information about the file.
5555
5656
photo (:obj:`Photo`, *optional*):
57-
Webpage is a photo, information about the photo.
57+
Webpage preview is a photo, information about the photo.
5858
5959
animation (:obj:`Animation`, *optional*):
60-
Webpage is an animation, information about the animation.
60+
Webpage preview is an animation, information about the animation.
6161
6262
video (:obj:`Video`, *optional*):
63-
Webpage is a video, information about the video.abs
63+
Webpage preview is a video, information about the video.
6464
6565
embed_url (``str``, *optional*):
6666
Embedded content URL.
6767
6868
embed_type (``str``, *optional*):
69-
Embedded content type, can be `iframe` #TODO
69+
Embedded content type, like `iframe`
7070
7171
embed_width (``int``, *optional*):
7272
Embedded content width.
@@ -75,10 +75,10 @@ class WebPage(Object):
7575
Embedded content height.
7676
7777
duration (``int``, *optional*):
78-
:shrug:
78+
Uknown at the time of writing.
7979
8080
author (``str``, *optional*):
81-
Author of the webpage, eg the Twitter user.
81+
Author of the webpage, eg the Twitter user for a tweet, or the author in an article.
8282
"""
8383

8484
__slots__ = [

0 commit comments

Comments
 (0)