Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified args and attrs in classes #3404

Merged
merged 74 commits into from Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
940a492
titles-only toctrees
Bibo-Joshi Nov 24, 2022
cf9b228
Conversationhandler docfix (#3395)
lemontree210 Nov 27, 2022
c53c721
fix(`Bot`): `:attr:`->`:meth:` in `seealso` where applicable
lemontree210 Nov 28, 2022
eb07a2b
Add more crossrefs to docstrings (#3398)
lemontree210 Nov 30, 2022
421518b
Clarify docs of the `filter` argument in `MessageHandler` (#3403)
Viicos Dec 1, 2022
d8d3d31
unify attrs and args in `Dice`
lemontree210 Dec 2, 2022
c627e86
unify attrs and args in `LoginURL`
lemontree210 Dec 2, 2022
c599963
fix(`User`): "bots"->"bot's" in args
lemontree210 Dec 2, 2022
88f0c65
`Update`: unify args and attrs
lemontree210 Dec 2, 2022
e61968d
`PollAnswer`: unify args and attrs
lemontree210 Dec 2, 2022
2980497
`MessageEntity`: unify args and attrs
lemontree210 Dec 2, 2022
b0ce3a4
`Location`: unify args and attrs
lemontree210 Dec 2, 2022
2d55ed8
`CallbackQuery`: unify args and attrs
lemontree210 Dec 2, 2022
717f643
`ChatInviteLink`: unify args and attrs
lemontree210 Dec 2, 2022
0bc70f6
`ChatLocation`: unify args and attrs
lemontree210 Dec 2, 2022
268a853
`ChatMember`: unify args and attrs
lemontree210 Dec 2, 2022
9fd18c7
Add a note in the line of #3401
Bibo-Joshi Dec 3, 2022
fddaf7f
`ChatMemberUpdated`: add to `invite_link` attr
lemontree210 Dec 3, 2022
58679f7
`File`: unify args and attrs
lemontree210 Dec 3, 2022
0e24a4b
`InlineKeyboardButton`: unify args and attrs, fix bold text
lemontree210 Dec 3, 2022
f4575af
minor(`InlineKeyboardButton`) add ref to class
lemontree210 Dec 5, 2022
83c0a4c
minor(`MenuButtonWebApp`) add ref to class `Bot`
lemontree210 Dec 5, 2022
df3e984
unify args and attrs in `UserProfilePhotos`
lemontree210 Dec 5, 2022
d93ac70
unify args and attrs in `StickerSet`
lemontree210 Dec 5, 2022
cce57ae
unify args and attrs in `MaskPosition`
lemontree210 Dec 5, 2022
d796bf4
unify args and attrs in `Sticker`
lemontree210 Dec 5, 2022
94bd384
unify args and attrs in `BotCommand`
lemontree210 Dec 5, 2022
d4d3600
unify args and attrs in `Game`
lemontree210 Dec 5, 2022
8b81e1f
`Animation`: unify args and attrs
lemontree210 Dec 6, 2022
9828dab
`Audio`: unify args and attrs
lemontree210 Dec 6, 2022
b2c3606
update furo
harshil21 Dec 7, 2022
c11ba1e
fix(`ChatPhoto`) rm "unique" from docstring of `big/small_file_id` attrs
lemontree210 Dec 7, 2022
c893aa5
'Document': unify args and attrs
lemontree210 Dec 7, 2022
d8f9f28
'Force Reply': unify args and attrs
lemontree210 Dec 7, 2022
00c4087
'InputMedia': unify args and attrs
lemontree210 Dec 7, 2022
7511938
minor: remove trailing colon in `versionchanged`
lemontree210 Dec 7, 2022
c92d818
`PhotoSize`: unify args and attrs
lemontree210 Dec 7, 2022
7b15311
`ReplyKeyboardMarkup`: unify args and attrs, fix type of `.keyboard` …
lemontree210 Dec 7, 2022
cc93abf
`ReplyKeyboardRemove`: unify args and attrs
lemontree210 Dec 8, 2022
3e0f791
`InputMedia...`: unify args and attrs + fix `InputMediaAudio.duration`
lemontree210 Dec 8, 2022
eabf480
minor(`InlineKeyboardButton`): add bold in `callback_game` attr
lemontree210 Dec 8, 2022
821b33d
`KeyboardButton`: unify args and attrs
lemontree210 Dec 8, 2022
110c030
fix(`KeyboardButtonPollType`): add `Args:` section
lemontree210 Dec 8, 2022
8789bea
`Venue`: unify args and attrs
lemontree210 Dec 8, 2022
de1e9e6
`Video`: unify args and attrs
lemontree210 Dec 8, 2022
864d9da
`VideoNote`: unify args and attrs
lemontree210 Dec 8, 2022
2890c0b
`Voice`: unify args and attrs + fix `duration`
lemontree210 Dec 8, 2022
2fe6d36
`ChosenInlineResult`: unify args and attrs
lemontree210 Dec 8, 2022
b294166
`InlineQuery`: unify args and attrs
lemontree210 Dec 8, 2022
be96d7a
`InlineQueryResultCachedAudio`: fix typo in attrs
lemontree210 Dec 8, 2022
5a8468b
`InlineQueryResultCachedGif`: fix typo in args
lemontree210 Dec 8, 2022
5456f22
`InlineQueryResult...[...Gif/...Mpeg4Gif]`: unify args and attrs
lemontree210 Dec 9, 2022
66a4d68
`InlineQueryResultLocation`: unify args and attrs
lemontree210 Dec 9, 2022
756994f
`InlineQueryResultVenue`: unify args and attrs
lemontree210 Dec 9, 2022
0c0f200
`InlineQueryResultVideo`: unify args and attrs
lemontree210 Dec 9, 2022
2bb0104
`InputTextMessageContent`: unify args and attrs
lemontree210 Dec 9, 2022
f56313c
`InputLocationMessageContent`: unify args and attrs
lemontree210 Dec 9, 2022
0a7642f
`InputVenueMessageContent`: unify args and attrs
lemontree210 Dec 9, 2022
fb08193
`InputInvoiceMessageContent`: unify args and attrs
lemontree210 Dec 9, 2022
d08fb9a
`Invoice`: unify args and attrs
lemontree210 Dec 9, 2022
0775af5
`LabeledPrice`: unify args and attrs
lemontree210 Dec 9, 2022
c5d3756
`PreCheckoutQuery`: unify args and attrs
lemontree210 Dec 9, 2022
0287c35
`SuccessfulPayment`: unify args and attrs
lemontree210 Dec 9, 2022
423ee44
`PassportFile`: unify args and attrs
lemontree210 Dec 9, 2022
16bbb30
add `Args` sections to `PersonalDetails`, `ResidentialAddress`, `IdDo…
lemontree210 Dec 9, 2022
a881c48
add `Args` sections to `SecureData`, `SecureValue`
lemontree210 Dec 9, 2022
dee43f0
add `message` arg to `PassportElementError`
lemontree210 Dec 9, 2022
367a86c
Merge remote-tracking branch 'origin/doc-fixes' into unified-args-and…
lemontree210 Dec 14, 2022
be44d40
merge `doc-fixes` (resolve conflicts)
lemontree210 Dec 16, 2022
4a9cd23
Merge remote-tracking branch 'origin/doc-fixes' into unified-args-and…
lemontree210 Dec 18, 2022
c078486
Merge remote-tracking branch 'origin/doc-fixes' into unified-args-and…
lemontree210 Dec 21, 2022
719d3bb
Merge remote-tracking branch 'origin/doc-fixes' into unified-args-and…
lemontree210 Dec 21, 2022
57eb906
`ChatInviteLink`: remove explanatory phrase for `invite_link` arg
lemontree210 Dec 23, 2022
e7da6ab
Merge remote-tracking branch 'origin/doc-fixes' into unified-args-and…
lemontree210 Dec 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions telegram/_botcommand.py
Expand Up @@ -41,8 +41,12 @@ class BotCommand(TelegramObject):
:tg-const:`telegram.BotCommand.MAX_DESCRIPTION` characters.

Attributes:
command (:obj:`str`): Text of the command.
description (:obj:`str`): Description of the command.
command (:obj:`str`): Text of the command; :tg-const:`telegram.BotCommand.MIN_COMMAND`-
:tg-const:`telegram.BotCommand.MAX_COMMAND` characters. Can contain only lowercase
English letters, digits and underscores.
description (:obj:`str`): Description of the command;
:tg-const:`telegram.BotCommand.MIN_DESCRIPTION`-
:tg-const:`telegram.BotCommand.MAX_DESCRIPTION` characters.

"""

Expand Down
14 changes: 9 additions & 5 deletions telegram/_callbackquery.py
Expand Up @@ -78,23 +78,27 @@ class CallbackQuery(TelegramObject):
inline_message_id (:obj:`str`, optional): Identifier of the message sent via the bot in
inline mode, that originated the query.
game_short_name (:obj:`str`, optional): Short name of a Game to be returned, serves as
the unique identifier for the game
the unique identifier for the game.

Attributes:
id (:obj:`str`): Unique identifier for this query.
from_user (:class:`telegram.User`): Sender.
chat_instance (:obj:`str`): Global identifier, uniquely corresponding to the chat to which
the message with the callback button was sent.
the message with the callback button was sent. Useful for high scores in games.
message (:class:`telegram.Message`): Optional. Message with the callback button that
originated the query.
originated the query. Note that message content and message date will not be available
if the message is too old.
data (:obj:`str` | :obj:`object`): Optional. Data associated with the callback button.
Be aware that the message, which originated the query, can contain no callback buttons
with this data.

Tip:
The value here is the same as the value passed in
:paramref:`telegram.InlineKeyboardButton.callback_data`.
inline_message_id (:obj:`str`): Optional. Identifier of the message sent via the bot in
inline mode, that originated the query.
game_short_name (:obj:`str`): Optional. Short name of a Game to be returned.
inline mode, that originated the query.
game_short_name (:obj:`str`): Optional. Short name of a Game to be returned, serves as
the unique identifier for the game.


"""
Expand Down
4 changes: 3 additions & 1 deletion telegram/_chatinvitelink.py
Expand Up @@ -44,7 +44,8 @@ class ChatInviteLink(TelegramObject):
* Comparing objects of this class now also takes :attr:`creates_join_request` into account.

Args:
invite_link (:obj:`str`): The invite link.
invite_link (:obj:`str`): The invite link. If the link was created by another chat
administrator, then the second part of the link will be replaced with ``'…'``.
lemontree210 marked this conversation as resolved.
Show resolved Hide resolved
creator (:class:`telegram.User`): Creator of the link.
creates_join_request (:obj:`bool`): :obj:`True`, if users joining the chat via
the link need to be approved by chat administrators.
Expand Down Expand Up @@ -83,6 +84,7 @@ class ChatInviteLink(TelegramObject):
:tg-const:`telegram.constants.ChatInviteLinkLimit.MIN_MEMBER_LIMIT`-
:tg-const:`telegram.constants.ChatInviteLinkLimit.MAX_MEMBER_LIMIT`.
name (:obj:`str`): Optional. Invite link name.
0-:tg-const:`telegram.constants.ChatInviteLinkLimit.NAME_LENGTH` characters.
lemontree210 marked this conversation as resolved.
Show resolved Hide resolved

.. versionadded:: 13.8
pending_join_request_count (:obj:`int`): Optional. Number of pending join requests
Expand Down
7 changes: 5 additions & 2 deletions telegram/_chatlocation.py
Expand Up @@ -40,10 +40,13 @@ class ChatLocation(TelegramObject):
Can't be a live location.
address (:obj:`str`): Location address;
:tg-const:`telegram.ChatLocation.MIN_ADDRESS`-
:tg-const:`telegram.ChatLocation.MAX_ADDRESS` characters, as defined by the chat owner
:tg-const:`telegram.ChatLocation.MAX_ADDRESS` characters, as defined by the chat owner.
Attributes:
location (:class:`telegram.Location`): The location to which the supergroup is connected.
address (:obj:`str`): Location address, as defined by the chat owner
Can't be a live location.
address (:obj:`str`): Location address;
:tg-const:`telegram.ChatLocation.MIN_ADDRESS`-
:tg-const:`telegram.ChatLocation.MAX_ADDRESS` characters, as defined by the chat owner.

"""

Expand Down
5 changes: 4 additions & 1 deletion telegram/_chatmember.py
Expand Up @@ -65,7 +65,10 @@ class ChatMember(TelegramObject):

Attributes:
user (:class:`telegram.User`): Information about the user.
status (:obj:`str`): The member's status in the chat.
status (:obj:`str`): The member's status in the chat. Can be
:attr:`~telegram.ChatMember.ADMINISTRATOR`, :attr:`~telegram.ChatMember.OWNER`,
:attr:`~telegram.ChatMember.BANNED`, :attr:`~telegram.ChatMember.LEFT`,
:attr:`~telegram.ChatMember.MEMBER` or :attr:`~telegram.ChatMember.RESTRICTED`.

"""

Expand Down
2 changes: 1 addition & 1 deletion telegram/_chatmemberupdated.py
Expand Up @@ -65,7 +65,7 @@ class ChatMemberUpdated(TelegramObject):
old_chat_member (:class:`telegram.ChatMember`): Previous information about the chat member.
new_chat_member (:class:`telegram.ChatMember`): New information about the chat member.
invite_link (:class:`telegram.ChatInviteLink`): Optional. Chat invite link, which was used
by the user to join the chat.
by the user to join the chat. For joining by invite link events only.

"""

Expand Down
7 changes: 5 additions & 2 deletions telegram/_choseninlineresult.py
Expand Up @@ -56,8 +56,11 @@ class ChosenInlineResult(TelegramObject):
Attributes:
result_id (:obj:`str`): The unique identifier for the result that was chosen.
from_user (:class:`telegram.User`): The user that chose the result.
location (:class:`telegram.Location`): Optional. Sender location.
inline_message_id (:obj:`str`): Optional. Identifier of the sent inline message.
location (:class:`telegram.Location`): Optional. Sender location, only for bots that
require user location.
inline_message_id (:obj:`str`): Optional. Identifier of the sent inline message. Available
only if there is an inline keyboard attached to the message. Will be also received in
callback queries and can be used to edit the message.
query (:obj:`str`): The query that was used to obtain the result.

"""
Expand Down
8 changes: 8 additions & 0 deletions telegram/_dice.py
Expand Up @@ -75,6 +75,14 @@ class Dice(TelegramObject):

Attributes:
value (:obj:`int`): Value of the dice.
:tg-const:`telegram.Dice.MIN_VALUE`-:tg-const:`telegram.Dice.MAX_VALUE_BOWLING`
for :tg-const:`telegram.Dice.DICE`, :tg-const:`telegram.Dice.DARTS` and
:tg-const:`telegram.Dice.BOWLING` base emoji,
:tg-const:`telegram.Dice.MIN_VALUE`-:tg-const:`telegram.Dice.MAX_VALUE_BASKETBALL`
for :tg-const:`telegram.Dice.BASKETBALL` and :tg-const:`telegram.Dice.FOOTBALL`
base emoji,
:tg-const:`telegram.Dice.MIN_VALUE`-:tg-const:`telegram.Dice.MAX_VALUE_SLOT_MACHINE`
for :tg-const:`telegram.Dice.SLOT_MACHINE` base emoji.
emoji (:obj:`str`): Emoji on which the dice throw animation is based.

"""
Expand Down
3 changes: 2 additions & 1 deletion telegram/_files/animation.py
Expand Up @@ -44,7 +44,8 @@ class Animation(_BaseThumbedMedium):
file_size (:obj:`int`, optional): File size in bytes.

Attributes:
file_id (:obj:`str`): File identifier.
file_id (:obj:`str`): Identifier for this file, which can be used to download
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
Expand Down
10 changes: 5 additions & 5 deletions telegram/_files/audio.py
Expand Up @@ -46,11 +46,11 @@ class Audio(_BaseThumbedMedium):
which the music file belongs.

Attributes:
file_id (:obj:`str`): Identifier for this file.
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds.
file_id (:obj:`str`): Identifier for this file, which can be used to download
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds as defined by sender.
performer (:obj:`str`): Optional. Performer of the audio as defined by sender or by audio
tags.
title (:obj:`str`): Optional. Title of the audio as defined by sender or by audio tags.
Expand Down
4 changes: 2 additions & 2 deletions telegram/_files/chatphoto.py
Expand Up @@ -36,15 +36,15 @@ class ChatPhoto(TelegramObject):
equal.

Args:
small_file_id (:obj:`str`): Unique file identifier of small
small_file_id (:obj:`str`): File identifier of small
(:tg-const:`telegram.ChatPhoto.SIZE_SMALL` x :tg-const:`telegram.ChatPhoto.SIZE_SMALL`)
chat photo. This file_id can be used only for photo download and only for as long
as the photo is not changed.
small_file_unique_id (:obj:`str`): Unique file identifier of small
(:tg-const:`telegram.ChatPhoto.SIZE_SMALL` x :tg-const:`telegram.ChatPhoto.SIZE_SMALL`)
chat photo, which is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
big_file_id (:obj:`str`): Unique file identifier of big
big_file_id (:obj:`str`): File identifier of big
(:tg-const:`telegram.ChatPhoto.SIZE_BIG` x :tg-const:`telegram.ChatPhoto.SIZE_BIG`)
chat photo. This file_id can be used only for photo download and only for as long as
the photo is not changed.
Expand Down
15 changes: 7 additions & 8 deletions telegram/_files/document.py
Expand Up @@ -41,16 +41,15 @@ class Document(_BaseThumbedMedium):
file_size (:obj:`int`, optional): File size in bytes.

Attributes:
file_id (:obj:`str`): File identifier.
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
thumb (:class:`telegram.PhotoSize`): Optional. Document thumbnail.
file_name (:obj:`str`): Original filename.
mime_type (:obj:`str`): Optional. MIME type of the file.
file_id (:obj:`str`): Identifier for this file, which can be used to download
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
thumb (:class:`telegram.PhotoSize`): Optional. Document thumbnail as defined by sender.
file_name (:obj:`str`): Optional. Original filename as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by sender.
file_size (:obj:`int`): Optional. File size in bytes.


"""

__slots__ = ("file_name", "mime_type")
Expand Down
13 changes: 7 additions & 6 deletions telegram/_files/file.py
Expand Up @@ -42,7 +42,7 @@ class File(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.

.. versionchanged:: 20.0:
.. versionchanged:: 20.0
``download`` was split into :meth:`download_to_drive` and :meth:`download_to_memory`.

Note:
Expand All @@ -58,18 +58,19 @@ class File(TelegramObject):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
file_size (:obj:`int`, optional): Optional. File size in bytes, if known.
file_size (:obj:`int`, optional): File size in bytes, if known.
file_path (:obj:`str`, optional): File path. Use e.g. :meth:`download_to_drive` to get the
file.

Attributes:
file_id (:obj:`str`): Identifier for this file.
file_id (:obj:`str`): Identifier for this file, which can be used to download
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
file_size (:obj:`str`): Optional. File size in bytes.
file_path (:obj:`str`): Optional. File path. Use e.g. :meth:`download_to_drive` to get
the file.
file_size (:obj:`int`): Optional. File size in bytes, if known.
lemontree210 marked this conversation as resolved.
Show resolved Hide resolved
file_path (:obj:`str`): Optional. File path. Use e.g. :meth:`download_to_drive` to get the
file.
"""

__slots__ = (
Expand Down