Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions telegram/_dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ class Dice(TelegramObject):
However, this behaviour is undocumented and might be changed by Telegram.

Args:
value (:obj:`int`): Value of the dice. 1-6 for dice, darts and bowling balls, 1-5 for
basketball and football/soccer ball, 1-64 for slot machine.
value (:obj:`int`): Value of dice. telegram.constants.DiceValueRange.DICE for dice, darts and
bowling balls, telegram.constants.DiceValueRange.BASKETBALL for basketball and football/soccer ball,
telegram.constants.DiceValueRange.SLOT_MACHINE for slot machine.
emoji (:obj:`str`): Emoji on which the dice throw animation is based.

Attributes:
value (:obj:`int`): Value of the dice.
value (:obj:`int`): Value of dice. telegram.constants.DiceValueRange.DICE for dice, darts and
bowling balls, telegram.constants.DiceValueRange.BASKETBALL for basketball and football/soccer ball,
telegram.constants.DiceValueRange.SLOT_MACHINE for slot machine.
emoji (:obj:`str`): Emoji on which the dice throw animation is based.

"""
Expand Down
18 changes: 15 additions & 3 deletions telegram/_loginurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LoginUrl(TelegramObject):
the original URL without information about the user will be opened. The data added is
the same as described in
`Receiving authorization data
<https://core.telegram.org/widgets/login#receiving-authorization-data>`_
<https://core.telegram.org/widgets/login#receiving-authorization-data>`_.
forward_text (:obj:`str`, optional): New text of the button in forwarded messages.
bot_username (:obj:`str`, optional): Username of a bot, which will be used for user
authorization. See
Expand All @@ -59,10 +59,22 @@ class LoginUrl(TelegramObject):
for your bot to send messages to the user.

Attributes:
url (:obj:`str`): An HTTPS URL to be opened with user authorization data.
url (:obj:`str`): An HTTPS URL to be opened with user authorization data added to the query
string when the button is pressed. If the user refuses to provide authorization data,
the original URL without information about the user will be opened. The data added is
the same as described in
`Receiving authorization data
<https://core.telegram.org/widgets/login#receiving-authorization-data>`_.
forward_text (:obj:`str`): Optional. New text of the button in forwarded messages.
bot_username (:obj:`str`): Optional. Username of a bot, which will be used for user
authorization.
authorization. See
`Setting up a bot <https://core.telegram.org/widgets/login#setting-up-a-bot>`_
for more details. If it was not specified, the current
bot's username will be assumed. The url's domain must be the same as the domain linked
with the bot. See
`Linking your domain to the bot
<https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot>`_
for more details.
request_write_access (:obj:`bool`): Optional. Pass :obj:`True` to request the permission
for your bot to send messages to the user.

Expand Down
18 changes: 18 additions & 0 deletions telegram/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,24 @@ class DiceEmoji(StringEnum):
""":obj:`str`: A :class:`telegram.Dice` with the emoji ``🎳``."""


class DiceValueRange(IntEnum):
"""This enum contains the values for :class:`telegram.Dice`/
:meth:`telegram.Bot.send_dice`. The
enum members of this enumeration are instances of :class:`int` and can be treated as such.

.. versionadded:: 20.0
"""

__slots__ = ()

DICE = range(1,7)
""":obj:`int`: A :class:`telegram.Dice` with the value 1-6."""
BASKETBALL = range(1,5)
""":obj:`int`: A :class:`telegram.Dice` with the value 1-5."""
SLOT_MACHINE = range(1,65)
""":obj:`int`: A :class:`telegram.Dice` with the value 1-64."""


class FileSizeLimit(IntEnum):
"""This enum contains limitations regarding the upload and download of files. The enum
members of this enumeration are instances of :class:`int` and can be treated as such.
Expand Down