Compare commits

..

6 Commits

Author SHA1 Message Date
Hinrich Mahler 92cb6f3ae8 Bump version to v13.11 2022-02-02 21:16:36 +01:00
Harshil a35ecf4065 API 5.7 (#2881) 2022-02-02 21:05:46 +01:00
Hinrich Mahler ade1529986 Bump version to v13.10 2022-01-03 08:36:27 +01:00
Harshil e6d9f3d057 Update Copyright to 2022 (#2836) 2022-01-03 08:15:18 +01:00
Harshil 98bf378c6e API 5.6 (#2835) 2022-01-03 08:13:33 +01:00
Poolitzer c4b413ef9e Update Documentation of BotCommand (#2820) 2021-12-17 16:12:34 +01:00
286 changed files with 1038 additions and 416 deletions
+31
View File
@@ -2,6 +2,37 @@
Changelog
=========
Version 13.11
=============
*Released 2022-02-02*
This is the technical changelog for version 13.11. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>`_.
**Major Changes:**
- Full Support for Bot API 5.7 (`#2881`_)
.. _`#2881`: https://github.com/python-telegram-bot/python-telegram-bot/pull/2881
Version 13.10
=============
*Released 2022-01-03*
This is the technical changelog for version 13.10. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>`_.
**Major Changes:**
- Full Support for API 5.6 (`#2835`_)
**Minor Changes & Doc fixes:**
- Update Copyright to 2022 (`#2836`_)
- Update Documentation of ``BotCommand`` (`#2820`_)
.. _`#2835`: https://github.com/python-telegram-bot/python-telegram-bot/pull/2835
.. _`#2836`: https://github.com/python-telegram-bot/python-telegram-bot/pull/2836
.. _`#2820`: https://github.com/python-telegram-bot/python-telegram-bot/pull/2820
Version 13.9
============
*Released 2021-12-11*
+2 -2
View File
@@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot/
:alt: Supported Python versions
.. image:: https://img.shields.io/badge/Bot%20API-5.5-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-5.7-blue?logo=telegram
:target: https://core.telegram.org/bots/api-changelog
:alt: Supported Bot API versions
@@ -111,7 +111,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================
All types and methods of the Telegram Bot API **5.5** are supported.
All types and methods of the Telegram Bot API **5.7** are supported.
==========
Installing
+2 -2
View File
@@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot-raw/
:alt: Supported Python versions
.. image:: https://img.shields.io/badge/Bot%20API-5.5-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-5.7-blue?logo=telegram
:target: https://core.telegram.org/bots/api-changelog
:alt: Supported Bot API versions
@@ -105,7 +105,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================
All types and methods of the Telegram Bot API **5.5** are supported.
All types and methods of the Telegram Bot API **5.7** are supported.
==========
Installing
+2 -2
View File
@@ -60,9 +60,9 @@ author = u'Leandro Toledo'
# built documents.
#
# The short X.Y version.
version = '13.9' # telegram.__version__[:3]
version = '13.11' # telegram.__version__[:3]
# The full version, including alpha/beta/rc tags.
release = '13.9' # telegram.__version__
release = '13.11' # telegram.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
# !/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+187 -29
View File
@@ -2,7 +2,7 @@
# pylint: disable=E0611,E0213,E1102,E1101,R0913,R0904
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -306,10 +306,14 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> Union[bool, Message]:
if reply_to_message_id is not None:
data['reply_to_message_id'] = reply_to_message_id
if protect_content:
data['protect_content'] = protect_content
# We don't check if (DEFAULT_)None here, so that _put is able to insert the defaults
# correctly, if necessary
data['disable_notification'] = disable_notification
@@ -463,6 +467,7 @@ class Bot(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> Message:
"""Use this method to send text messages.
@@ -480,6 +485,10 @@ class Bot(TelegramObject):
this message.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of sent messages from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -519,6 +528,7 @@ class Bot(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -576,6 +586,7 @@ class Bot(TelegramObject):
disable_notification: DVInput[bool] = DEFAULT_NONE,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> Message:
"""Use this method to forward messages of any kind. Service messages can't be forwarded.
@@ -595,6 +606,11 @@ class Bot(TelegramObject):
message_id (:obj:`int`): Message identifier in the chat specified in from_chat_id.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
timeout (:obj:`int` | :obj:`float`, optional): If this value is specified, use it as
the read timeout from the server (instead of the one specified during creation of
the connection pool).
@@ -616,13 +632,13 @@ class Bot(TelegramObject):
data['from_chat_id'] = from_chat_id
if message_id:
data['message_id'] = message_id
return self._message( # type: ignore[return-value]
'forwardMessage',
data,
disable_notification=disable_notification,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -640,6 +656,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""Use this method to send photos.
@@ -674,6 +691,11 @@ class Bot(TelegramObject):
:attr:`parse_mode`.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -713,6 +735,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -734,6 +757,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send audio files, if you want Telegram clients to display them in the
@@ -778,6 +802,11 @@ class Bot(TelegramObject):
title (:obj:`str`, optional): Track name.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -834,6 +863,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -853,6 +883,7 @@ class Bot(TelegramObject):
disable_content_type_detection: bool = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send general files.
@@ -891,6 +922,11 @@ class Bot(TelegramObject):
:attr:`parse_mode`.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -943,6 +979,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -956,9 +993,10 @@ class Bot(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""
Use this method to send static .WEBP or animated .TGS stickers.
Use this method to send static ``.WEBP``, animated ``.TGS``, or video ``.WEBM`` stickers.
Note:
The sticker argument can be either a file_id, an URL or a file from disk
@@ -978,6 +1016,11 @@ class Bot(TelegramObject):
Accept :obj:`bytes` as input.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1007,6 +1050,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1029,6 +1073,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send video files, Telegram clients support mp4 videos
@@ -1076,6 +1121,11 @@ class Bot(TelegramObject):
suitable for streaming.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1133,6 +1183,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1150,6 +1201,7 @@ class Bot(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
@@ -1184,6 +1236,11 @@ class Bot(TelegramObject):
message.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1232,6 +1289,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1253,6 +1311,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
@@ -1303,6 +1362,11 @@ class Bot(TelegramObject):
:attr:`parse_mode`.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1349,6 +1413,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1367,6 +1432,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send audio files, if you want Telegram clients to display the file
@@ -1406,6 +1472,11 @@ class Bot(TelegramObject):
duration (:obj:`int`, optional): Duration of the voice message in seconds.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1447,6 +1518,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1461,6 +1533,7 @@ class Bot(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> List[Message]:
"""Use this method to send a group of photos or videos as an album.
@@ -1472,6 +1545,11 @@ class Bot(TelegramObject):
describing messages to be sent, must include 210 items.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1503,6 +1581,9 @@ class Bot(TelegramObject):
if reply_to_message_id:
data['reply_to_message_id'] = reply_to_message_id
if protect_content:
data['protect_content'] = protect_content
result = self._post('sendMediaGroup', data, timeout=timeout, api_kwargs=api_kwargs)
return Message.de_list(result, self) # type: ignore
@@ -1524,6 +1605,7 @@ class Bot(TelegramObject):
heading: int = None,
proximity_alert_radius: int = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""Use this method to send point on the map.
@@ -1547,6 +1629,11 @@ class Bot(TelegramObject):
between 1 and 100000 if specified.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1601,6 +1688,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1761,6 +1849,7 @@ class Bot(TelegramObject):
google_place_id: str = None,
google_place_type: str = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""Use this method to send information about a venue.
@@ -1790,6 +1879,11 @@ class Bot(TelegramObject):
venue (:class:`telegram.Venue`, optional): The venue to send.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1852,6 +1946,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1869,6 +1964,7 @@ class Bot(TelegramObject):
vcard: str = None,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""Use this method to send phone contacts.
@@ -1887,6 +1983,11 @@ class Bot(TelegramObject):
contact (:class:`telegram.Contact`, optional): The contact to send.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1938,6 +2039,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -1951,6 +2053,7 @@ class Bot(TelegramObject):
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""Use this method to send a game.
@@ -1960,6 +2063,11 @@ class Bot(TelegramObject):
for the game. Set up your games via `@BotFather <https://t.me/BotFather>`_.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -1991,6 +2099,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -3505,6 +3614,7 @@ class Bot(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
max_tip_amount: int = None,
suggested_tip_amounts: List[int] = None,
protect_content: bool = None,
) -> Message:
"""Use this method to send invoices.
@@ -3579,6 +3689,11 @@ class Bot(TelegramObject):
the shipping method.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -3651,6 +3766,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -4637,7 +4753,7 @@ class Bot(TelegramObject):
api_kwargs: JSONDict = None,
) -> File:
"""
Use this method to upload a .png file with a sticker for later use in
Use this method to upload a ``.PNG`` file with a sticker for later use in
:meth:`create_new_sticker_set` and :meth:`add_sticker_to_set` methods (can be used multiple
times).
@@ -4648,9 +4764,8 @@ class Bot(TelegramObject):
Args:
user_id (:obj:`int`): User identifier of sticker file owner.
png_sticker (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`):
Png image with the sticker,
must be up to 512 kilobytes in size, dimensions must not exceed 512px,
and either width or height must be exactly 512px.
**PNG** image with the sticker, must be up to 512 kilobytes in size,
dimensions must not exceed 512px, and either width or height must be exactly 512px.
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
@@ -4686,11 +4801,13 @@ class Bot(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
tgs_sticker: FileInput = None,
api_kwargs: JSONDict = None,
webm_sticker: FileInput = None,
) -> bool:
"""
Use this method to create new sticker set owned by a user.
The bot will be able to edit the created sticker set.
You must use exactly one of the fields ``png_sticker`` or ``tgs_sticker``.
You must use exactly one of the fields ``png_sticker``, ``tgs_sticker``, or
``webm_sticker``.
Warning:
As of API 4.7 ``png_sticker`` is an optional argument and therefore the order of the
@@ -4710,7 +4827,7 @@ class Bot(TelegramObject):
1-64 characters.
title (:obj:`str`): Sticker set title, 1-64 characters.
png_sticker (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`, \
optional): Png image with the sticker,
optional): **PNG** image with the sticker,
must be up to 512 kilobytes in size, dimensions must not exceed 512px,
and either width or height must be exactly 512px. Pass a file_id as a String to
send a file that already exists on the Telegram servers, pass an HTTP URL as a
@@ -4720,13 +4837,19 @@ class Bot(TelegramObject):
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
tgs_sticker (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`, \
optional): TGS animation with the sticker,
uploaded using multipart/form-data. See
https://core.telegram.org/animated_stickers#technical-requirements for technical
optional): **TGS** animation with the sticker, uploaded using multipart/form-data.
See https://core.telegram.org/stickers#animated-sticker-requirements for technical
requirements.
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
webm_sticker (:obj:`str` | :term:`file object` | :obj:`bytes` | :class:`pathlib.Path`,\
optional): **WEBM** video with the sticker, uploaded using multipart/form-data.
See https://core.telegram.org/stickers#video-sticker-requirements for
technical requirements.
.. versionadded:: 13.11
emojis (:obj:`str`): One or more emoji corresponding to the sticker.
contains_masks (:obj:`bool`, optional): Pass :obj:`True`, if a set of mask stickers
should be created.
@@ -4751,6 +4874,8 @@ class Bot(TelegramObject):
data['png_sticker'] = parse_file_input(png_sticker)
if tgs_sticker is not None:
data['tgs_sticker'] = parse_file_input(tgs_sticker)
if webm_sticker is not None:
data['webm_sticker'] = parse_file_input(webm_sticker)
if contains_masks is not None:
data['contains_masks'] = contains_masks
if mask_position is not None:
@@ -4773,12 +4898,14 @@ class Bot(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
tgs_sticker: FileInput = None,
api_kwargs: JSONDict = None,
webm_sticker: FileInput = None,
) -> bool:
"""
Use this method to add a new sticker to a set created by the bot.
You must use exactly one of the fields ``png_sticker`` or ``tgs_sticker``. Animated
stickers can be added to animated sticker sets and only to them. Animated sticker sets can
have up to 50 stickers. Static sticker sets can have up to 120 stickers.
You **must** use exactly one of the fields ``png_sticker``, ``tgs_sticker`` or
``webm_sticker``. Animated stickers can be added to animated sticker sets and only to them.
Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120
stickers.
Warning:
As of API 4.7 ``png_sticker`` is an optional argument and therefore the order of the
@@ -4794,7 +4921,7 @@ class Bot(TelegramObject):
name (:obj:`str`): Sticker set name.
png_sticker (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`, \
optional): PNG image with the sticker,
optional): **PNG** image with the sticker,
must be up to 512 kilobytes in size, dimensions must not exceed 512px,
and either width or height must be exactly 512px. Pass a file_id as a String to
send a file that already exists on the Telegram servers, pass an HTTP URL as a
@@ -4804,13 +4931,18 @@ class Bot(TelegramObject):
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
tgs_sticker (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`, \
optional): TGS animation with the sticker,
uploaded using multipart/form-data. See
https://core.telegram.org/animated_stickers#technical-requirements for technical
optional): **TGS** animation with the sticker, uploaded using multipart/form-data.
See https://core.telegram.org/stickers#animated-sticker-requirements for technical
requirements.
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
webm_sticker (:obj:`str` | :term:`file object` | :obj:`bytes` | :class:`pathlib.Path`,\
optional): **WEBM** video with the sticker, uploaded using multipart/form-data.
See https://core.telegram.org/stickers#video-sticker-requirements for
technical requirements.
.. versionadded:: 13.11
emojis (:obj:`str`): One or more emoji corresponding to the sticker.
mask_position (:class:`telegram.MaskPosition`, optional): Position where the mask
should be placed on faces.
@@ -4833,6 +4965,8 @@ class Bot(TelegramObject):
data['png_sticker'] = parse_file_input(png_sticker)
if tgs_sticker is not None:
data['tgs_sticker'] = parse_file_input(tgs_sticker)
if webm_sticker is not None:
data['webm_sticker'] = parse_file_input(webm_sticker)
if mask_position is not None:
# We need to_json() instead of to_dict() here, because we're sending a media
# message here, which isn't json dumped by utils.request
@@ -4916,7 +5050,8 @@ class Bot(TelegramObject):
api_kwargs: JSONDict = None,
) -> bool:
"""Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set
for animated sticker sets only.
for animated sticker sets only. Video thumbnails can be set only for video sticker sets
only.
Note:
The thumb can be either a file_id, an URL or a file from disk ``open(filename, 'rb')``
@@ -4925,14 +5060,17 @@ class Bot(TelegramObject):
name (:obj:`str`): Sticker set name
user_id (:obj:`int`): User identifier of created sticker set owner.
thumb (:obj:`str` | `filelike object` | :obj:`bytes` | :class:`pathlib.Path`, \
optional): A PNG image with the thumbnail, must
be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS
animation with the thumbnail up to 32 kilobytes in size; see
https://core.telegram.org/animated_stickers#technical-requirements for animated
sticker technical requirements. Pass a file_id as a String to send a file that
optional): A **PNG** image with the thumbnail, must
be up to 128 kilobytes in size and have width and height exactly 100px, or a
**TGS** animation with the thumbnail up to 32 kilobytes in size; see
https://core.telegram.org/stickers#animated-sticker-requirements for animated
sticker technical requirements, or a **WEBM** video with the thumbnail up to 32
kilobytes in size; see
https://core.telegram.org/stickers#video-sticker-requirements for video sticker
technical requirements. Pass a file_id as a String to send a file that
already exists on the Telegram servers, pass an HTTP URL as a String for Telegram
to get a file from the Internet, or upload a new one using multipart/form-data.
Animated sticker set thumbnail can't be uploaded via HTTP URL.
Animated sticker set thumbnails can't be uploaded via HTTP URL.
.. versionchanged:: 13.2
Accept :obj:`bytes` as input.
@@ -5021,6 +5159,7 @@ class Bot(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
explanation_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> Message:
"""
Use this method to send a native poll.
@@ -5059,6 +5198,11 @@ class Bot(TelegramObject):
immediately closed. This can be useful for poll preview.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -5118,6 +5262,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -5177,6 +5322,7 @@ class Bot(TelegramObject):
emoji: str = None,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> Message:
"""
Use this method to send an animated emoji that will display a random value.
@@ -5193,6 +5339,11 @@ class Bot(TelegramObject):
Added the "🎳" emoji.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -5213,9 +5364,7 @@ class Bot(TelegramObject):
:class:`telegram.error.TelegramError`
"""
data: JSONDict = {
'chat_id': chat_id,
}
data: JSONDict = {'chat_id': chat_id}
if emoji:
data['emoji'] = emoji
@@ -5229,6 +5378,7 @@ class Bot(TelegramObject):
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
@log
@@ -5454,6 +5604,7 @@ class Bot(TelegramObject):
reply_markup: ReplyMarkup = None,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> MessageId:
"""
Use this method to copy messages of any kind. Service messages and invoice messages can't
@@ -5475,6 +5626,11 @@ class Bot(TelegramObject):
parse_mode
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
forwarding and saving.
.. versionadded:: 13.10
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
@@ -5508,6 +5664,8 @@ class Bot(TelegramObject):
data['caption_entities'] = caption_entities
if reply_to_message_id:
data['reply_to_message_id'] = reply_to_message_id
if protect_content:
data['protect_content'] = protect_content
if reply_markup:
if isinstance(reply_markup, ReplyMarkup):
# We need to_json() instead of to_dict() here, because reply_markups may be
+2 -2
View File
@@ -2,7 +2,7 @@
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -33,7 +33,7 @@ class BotCommand(TelegramObject):
Args:
command (:obj:`str`): Text of the command, 1-32 characters. Can contain only lowercase
English letters, digits and underscores.
description (:obj:`str`): Description of the command, 3-256 characters.
description (:obj:`str`): Description of the command, 1-256 characters.
Attributes:
command (:obj:`str`): Text of the command.
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+3 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -620,6 +620,7 @@ class CallbackQuery(TelegramObject):
reply_markup: ReplyMarkup = None,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> 'MessageId':
"""Shortcut for::
@@ -648,6 +649,7 @@ class CallbackQuery(TelegramObject):
reply_markup=reply_markup,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
MAX_ANSWER_TEXT_LENGTH: ClassVar[int] = constants.MAX_ANSWER_CALLBACK_QUERY_TEXT_LENGTH
+39 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=W0622
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -792,6 +792,7 @@ class Chat(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -815,6 +816,7 @@ class Chat(TelegramObject):
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
entities=entities,
protect_content=protect_content,
)
def send_media_group(
@@ -827,6 +829,7 @@ class Chat(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> List['Message']:
"""Shortcut for::
@@ -846,6 +849,7 @@ class Chat(TelegramObject):
timeout=timeout,
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_chat_action(
@@ -887,6 +891,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -911,6 +916,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
filename=filename,
protect_content=protect_content,
)
def send_contact(
@@ -926,6 +932,7 @@ class Chat(TelegramObject):
vcard: str = None,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -950,6 +957,7 @@ class Chat(TelegramObject):
vcard=vcard,
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_audio(
@@ -969,6 +977,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -997,6 +1006,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
filename=filename,
protect_content=protect_content,
)
def send_document(
@@ -1014,6 +1024,7 @@ class Chat(TelegramObject):
disable_content_type_detection: bool = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1040,6 +1051,7 @@ class Chat(TelegramObject):
disable_content_type_detection=disable_content_type_detection,
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
protect_content=protect_content,
)
def send_dice(
@@ -1051,6 +1063,7 @@ class Chat(TelegramObject):
emoji: str = None,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1071,6 +1084,7 @@ class Chat(TelegramObject):
emoji=emoji,
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_game(
@@ -1082,6 +1096,7 @@ class Chat(TelegramObject):
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1102,6 +1117,7 @@ class Chat(TelegramObject):
timeout=timeout,
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_invoice(
@@ -1133,6 +1149,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
max_tip_amount: int = None,
suggested_tip_amounts: List[int] = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1181,6 +1198,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
max_tip_amount=max_tip_amount,
suggested_tip_amounts=suggested_tip_amounts,
protect_content=protect_content,
)
def send_location(
@@ -1198,6 +1216,7 @@ class Chat(TelegramObject):
heading: int = None,
proximity_alert_radius: int = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1224,6 +1243,7 @@ class Chat(TelegramObject):
heading=heading,
proximity_alert_radius=proximity_alert_radius,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_animation(
@@ -1243,6 +1263,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1271,6 +1292,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
filename=filename,
protect_content=protect_content,
)
def send_sticker(
@@ -1282,6 +1304,7 @@ class Chat(TelegramObject):
timeout: DVInput[float] = DEFAULT_20,
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1302,6 +1325,7 @@ class Chat(TelegramObject):
timeout=timeout,
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_venue(
@@ -1321,6 +1345,7 @@ class Chat(TelegramObject):
google_place_id: str = None,
google_place_type: str = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1349,6 +1374,7 @@ class Chat(TelegramObject):
google_place_id=google_place_id,
google_place_type=google_place_type,
allow_sending_without_reply=allow_sending_without_reply,
protect_content=protect_content,
)
def send_video(
@@ -1369,6 +1395,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1398,6 +1425,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
filename=filename,
protect_content=protect_content,
)
def send_video_note(
@@ -1413,6 +1441,7 @@ class Chat(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1437,6 +1466,7 @@ class Chat(TelegramObject):
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
filename=filename,
protect_content=protect_content,
)
def send_voice(
@@ -1453,6 +1483,7 @@ class Chat(TelegramObject):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
filename: str = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1478,6 +1509,7 @@ class Chat(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
caption_entities=caption_entities,
filename=filename,
protect_content=protect_content,
)
def send_poll(
@@ -1501,6 +1533,7 @@ class Chat(TelegramObject):
api_kwargs: JSONDict = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
explanation_entities: Union[List['MessageEntity'], Tuple['MessageEntity', ...]] = None,
protect_content: bool = None,
) -> 'Message':
"""Shortcut for::
@@ -1532,6 +1565,7 @@ class Chat(TelegramObject):
api_kwargs=api_kwargs,
allow_sending_without_reply=allow_sending_without_reply,
explanation_entities=explanation_entities,
protect_content=protect_content,
)
def send_copy(
@@ -1547,6 +1581,7 @@ class Chat(TelegramObject):
reply_markup: 'ReplyMarkup' = None,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> 'MessageId':
"""Shortcut for::
@@ -1571,6 +1606,7 @@ class Chat(TelegramObject):
reply_markup=reply_markup,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
def copy_message(
@@ -1586,6 +1622,7 @@ class Chat(TelegramObject):
reply_markup: 'ReplyMarkup' = None,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> 'MessageId':
"""Shortcut for::
@@ -1610,6 +1647,7 @@ class Chat(TelegramObject):
reply_markup=reply_markup,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
def export_invite_link(
+1 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=R0902,R0913
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+8 -3
View File
@@ -1,5 +1,5 @@
# python-telegram-bot - a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# by the python-telegram-bot contributors <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@ The following constants were extracted from the
`Telegram Bots API <https://core.telegram.org/bots/api>`_.
Attributes:
BOT_API_VERSION (:obj:`str`): `5.5`. Telegram Bot API version supported by this
BOT_API_VERSION (:obj:`str`): `5.7`. Telegram Bot API version supported by this
version of `python-telegram-bot`. Also available as ``telegram.bot_api_version``.
.. versionadded:: 13.4
@@ -141,6 +141,9 @@ Attributes:
MESSAGEENTITY_TEXT_MENTION (:obj:`str`): ``'text_mention'``
MESSAGEENTITY_UNDERLINE (:obj:`str`): ``'underline'``
MESSAGEENTITY_STRIKETHROUGH (:obj:`str`): ``'strikethrough'``
MESSAGEENTITY_SPOILER (:obj:`str`): ``'spoiler'``
.. versionadded:: 13.10
MESSAGEENTITY_ALL_TYPES (List[:obj:`str`]): List of all the types of message entity.
:class:`telegram.ParseMode`:
@@ -244,7 +247,7 @@ Attributes:
"""
from typing import List
BOT_API_VERSION: str = '5.5'
BOT_API_VERSION: str = '5.7'
MAX_MESSAGE_LENGTH: int = 4096
MAX_CAPTION_LENGTH: int = 1024
ANONYMOUS_ADMIN_ID: int = 1087968824
@@ -321,6 +324,7 @@ MESSAGEENTITY_TEXT_LINK: str = 'text_link'
MESSAGEENTITY_TEXT_MENTION: str = 'text_mention'
MESSAGEENTITY_UNDERLINE: str = 'underline'
MESSAGEENTITY_STRIKETHROUGH: str = 'strikethrough'
MESSAGEENTITY_SPOILER: str = 'spoiler'
MESSAGEENTITY_ALL_TYPES: List[str] = [
MESSAGEENTITY_MENTION,
MESSAGEENTITY_HASHTAG,
@@ -337,6 +341,7 @@ MESSAGEENTITY_ALL_TYPES: List[str] = [
MESSAGEENTITY_TEXT_MENTION,
MESSAGEENTITY_UNDERLINE,
MESSAGEENTITY_STRIKETHROUGH,
MESSAGEENTITY_SPOILER,
]
PARSEMODE_MARKDOWN: str = 'Markdown'
+1 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -20
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -17,24 +16,6 @@
#
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser Public License for more details.
#
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains the CallbackDataCache class."""
import logging
import time
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2019-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2020
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2020-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -356,7 +356,7 @@ class Dispatcher(Generic[CCT, UD, CD, BD]):
raise RuntimeError(f'{cls.__name__} not initialized or multiple instances exist')
def _pooled(self) -> None:
thr_name = current_thread().getName()
thr_name = current_thread().name
while 1:
promise = self.__async_queue.get()
+5 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=E0611,E0213,E1102,C0103,E1101,R0913,R0904
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -193,6 +193,7 @@ class ExtBot(telegram.bot.Bot):
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> Union[bool, Message]:
# We override this method to call self._replace_keyboard and self._insert_callback_data.
# This covers most methods that have a reply_markup
@@ -205,6 +206,7 @@ class ExtBot(telegram.bot.Bot):
allow_sending_without_reply=allow_sending_without_reply,
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
if isinstance(result, Message):
self._insert_callback_data(result)
@@ -299,6 +301,7 @@ class ExtBot(telegram.bot.Bot):
reply_markup: ReplyMarkup = None,
timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict = None,
protect_content: bool = None,
) -> MessageId:
# We override this method to call self._replace_keyboard
return super().copy_message(
@@ -314,6 +317,7 @@ class ExtBot(telegram.bot.Bot):
reply_markup=self._replace_keyboard(reply_markup),
timeout=timeout,
api_kwargs=api_kwargs,
protect_content=protect_content,
)
def get_chat(
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -4,7 +4,7 @@
# Tymofii A. Khodniev (thodnev) <thodnev@mail.ru>
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+3 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2019-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -14,8 +14,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser Public License for more details.
#
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains the PollAnswerHandler class."""
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2019-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,6 +1,6 @@
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=W0622,E0611
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+39 -11
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -34,6 +34,11 @@ class Sticker(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.
Note:
As of v13.11 ``is_video`` is a required argument and therefore the order of the
arguments had to be changed. Use keyword arguments to make sure that the arguments are
passed correctly.
Args:
file_id (:obj:`str`): Identifier for this file, which can be used to download
or reuse the file.
@@ -43,6 +48,9 @@ class Sticker(TelegramObject):
width (:obj:`int`): Sticker width.
height (:obj:`int`): Sticker height.
is_animated (:obj:`bool`): :obj:`True`, if the sticker is animated.
is_video (:obj:`bool`): :obj:`True`, if the sticker is a video sticker.
.. versionadded:: 13.11
thumb (:class:`telegram.PhotoSize`, optional): Sticker thumbnail in the .WEBP or .JPG
format.
emoji (:obj:`str`, optional): Emoji associated with the sticker
@@ -62,6 +70,9 @@ class Sticker(TelegramObject):
width (:obj:`int`): Sticker width.
height (:obj:`int`): Sticker height.
is_animated (:obj:`bool`): :obj:`True`, if the sticker is animated.
is_video (:obj:`bool`): :obj:`True`, if the sticker is a video sticker.
.. versionadded:: 13.11
thumb (:class:`telegram.PhotoSize`): Optional. Sticker thumbnail in the .webp or .jpg
format.
emoji (:obj:`str`): Optional. Emoji associated with the sticker.
@@ -78,6 +89,7 @@ class Sticker(TelegramObject):
'width',
'file_id',
'is_animated',
'is_video',
'file_size',
'thumb',
'set_name',
@@ -95,6 +107,7 @@ class Sticker(TelegramObject):
width: int,
height: int,
is_animated: bool,
is_video: bool,
thumb: PhotoSize = None,
emoji: str = None,
file_size: int = None,
@@ -109,6 +122,7 @@ class Sticker(TelegramObject):
self.width = int(width)
self.height = int(height)
self.is_animated = is_animated
self.is_video = is_video
# Optionals
self.thumb = thumb
self.emoji = emoji
@@ -155,28 +169,40 @@ class StickerSet(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`name` is equal.
Attributes:
name (:obj:`str`): Sticker set name.
title (:obj:`str`): Sticker set title.
is_animated (:obj:`bool`): :obj:`True`, if the sticker set contains animated stickers.
contains_masks (:obj:`bool`): :obj:`True`, if the sticker set contains masks.
stickers (List[:class:`telegram.Sticker`]): List of all set stickers.
thumb (:class:`telegram.PhotoSize`): Optional. Sticker set thumbnail in the .WEBP or .TGS
format.
Note:
As of v13.11 ``is_video`` is a required argument and therefore the order of the
arguments had to be changed. Use keyword arguments to make sure that the arguments are
passed correctly.
Args:
name (:obj:`str`): Sticker set name.
title (:obj:`str`): Sticker set title.
is_animated (:obj:`bool`): :obj:`True`, if the sticker set contains animated stickers.
is_video (:obj:`bool`): :obj:`True`, if the sticker set contains video stickers.
.. versionadded:: 13.11
contains_masks (:obj:`bool`): :obj:`True`, if the sticker set contains masks.
stickers (List[:class:`telegram.Sticker`]): List of all set stickers.
thumb (:class:`telegram.PhotoSize`, optional): Sticker set thumbnail in the .WEBP or .TGS
format.
thumb (:class:`telegram.PhotoSize`, optional): Sticker set thumbnail in the ``.WEBP``,
``.TGS``, or ``.WEBM`` format.
Attributes:
name (:obj:`str`): Sticker set name.
title (:obj:`str`): Sticker set title.
is_animated (:obj:`bool`): :obj:`True`, if the sticker set contains animated stickers.
is_video (:obj:`bool`): :obj:`True`, if the sticker set contains video stickers.
.. versionadded:: 13.11
contains_masks (:obj:`bool`): :obj:`True`, if the sticker set contains masks.
stickers (List[:class:`telegram.Sticker`]): List of all set stickers.
thumb (:class:`telegram.PhotoSize`): Optional. Sticker set thumbnail in the ``.WEBP``,
``.TGS`` or ``.WEBM`` format.
"""
__slots__ = (
'is_animated',
'is_video',
'contains_masks',
'thumb',
'title',
@@ -192,12 +218,14 @@ class StickerSet(TelegramObject):
is_animated: bool,
contains_masks: bool,
stickers: List[Sticker],
is_video: bool,
thumb: PhotoSize = None,
**_kwargs: Any,
):
self.name = name
self.title = title
self.is_animated = is_animated
self.is_video = is_video
self.contains_masks = contains_masks
self.stickers = stickers
# Optionals
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -2,7 +2,7 @@
# pylint: disable=R0902,R0913
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify

Some files were not shown because too many files have changed in this diff Show More