Compare commits

...

34 Commits

Author SHA1 Message Date
_run e10517e088
Merge pull request #2017 from Artin-GH/patch-1
Fix backslash (\) issue in escape_markdown
2023-07-30 23:19:57 +05:00
Artin GH 1946393c36
Fix backslash (\) issue in escape_markdown 2023-07-14 16:39:50 +03:30
Badiboy 0f52ca688f
Merge pull request #2015 from Badiboy/master
Fix aioredis version check for regular redis
2023-07-14 13:00:03 +03:00
Badiboy b18bcd494a Fix aioredis version check for regular redis 2023-07-12 19:48:22 +03:00
Badiboy 8f41df0ee4
Merge pull request #2012 from Kourva/master
Update README.md
2023-07-10 19:01:09 +03:00
Kourva cb7f6a8c99
Update README.md 2023-07-10 03:05:34 +03:30
_run 3960115ec7
Merge pull request #2009 from coder2020official/fileupload
Fixes #1944: uploading file from memory
2023-07-09 00:06:02 +05:00
_run 916569cdc5
Fixes #1944: uploading file from memory 2023-07-08 23:42:47 +05:00
_run 75d3fa2eba
Merge pull request #2008 from coder2020official/middleware
Fix issue with post_process in async not receiving the error
2023-07-08 23:25:05 +05:00
_run 67e3774e8e
Fix issue with post_process in async not receiving the error 2023-07-08 23:23:23 +05:00
_run f799157314
Merge pull request #2007 from coder2020official/master
Updated all russian docstrings, currently without translation.
2023-07-08 23:15:05 +05:00
coder2020official af3a98057f Updated all russian docstrings, currently without translation. 2023-07-08 23:10:41 +05:00
_run 447fc1d461
Merge pull request #2006 from coder2020official/master
Fixed deprecation warning for readthedocs.org
2023-07-08 23:01:57 +05:00
_run fb98df3dfe
Fixed deprecation warning for readthedocs.org 2023-07-08 22:57:13 +05:00
Badiboy 0b34da3900
Merge pull request #1996 from artemetra/master
Fix typo in docs
2023-06-18 23:19:00 +03:00
Artem Lukin 5ea1abaadd
fix typo in docs 2023-06-18 01:57:08 +02:00
Badiboy 5a81353420
Merge pull request #1991 from eternnoir/dependabot/pip/requests-2.31.0
Bump requests from 2.20.0 to 2.31.0
2023-05-28 22:27:49 +03:00
dependabot[bot] eaf90cce7f
Bump requests from 2.20.0 to 2.31.0
Bumps [requests](https://github.com/psf/requests) from 2.20.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.20.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 21:33:40 +00:00
Badiboy b219218c8d
Merge pull request #1988 from Badiboy/master
Bump version to 4.12.0
2023-05-18 18:09:13 +03:00
Badiboy 2dac17aa75 Bump version to 4.12.0 2023-05-18 18:07:09 +03:00
Badiboy 48377ac905
Merge pull request #1947 from alex75311/edit_antiflood_method
redesigned the antiflood method for guaranteed message delivery
2023-05-08 09:10:28 +03:00
Alexey Isaev 14294d1aa3 redesigned the antiflood method for guaranteed message delivery 2023-05-04 23:08:10 +03:00
_run ea3c159044
Merge pull request #1975 from engAmirEng/feature/async-func-filter
bring back the async func message_filter
2023-05-02 20:43:48 +04:00
AmirW 58d53e1a54 bring back the async func message_filter
-fixes #1974
- related commits: c84896391e f69a2ba044
2023-04-28 16:12:23 +03:30
Badiboy abec3dc60e
Merge pull request #1969 from coder2020official/botapi6.7
Bot API 6.7 - Not much to do, just minor improvements
2023-04-24 09:38:21 +03:00
coder2020official ecb5d9b4f6 Added tests for __html_text, fixed the bug, added custom_emoji for entities 2023-04-22 22:53:57 +04:00
coder2020official 26575dc5e7 Added support for launching Web Apps from inline query results by replacing the parameters switch_pm_text and switch_pm_parameter of the method answerInlineQuery with the parameter button of type InlineQueryResultsButton. 2023-04-22 20:51:08 +04:00
coder2020official be69feb252 * Added a test for message entity __html_text function. #1971 should be fixed and then todo can be done. 2023-04-22 20:38:05 +04:00
coder2020official 1d62adc262 Added the ability to get the current bot name in the given language as the class BotName using the method getMyName. 2023-04-22 18:30:46 +04:00
coder2020official 77e1928628 Added the ability to set different bot names for different user languages using the method setMyName. 2023-04-22 18:25:24 +04:00
coder2020official d6f4987197 Added the field via_chat_folder_invite_link to the class ChatMemberUpdated. 2023-04-21 22:30:32 +04:00
coder2020official 966b451869 Added the field switch_inline_query_chosen_chat of the type SwitchInlineQueryChosenChat to the class InlineKeyboardButton, which allows bots to switch to inline mode in a chosen chat of the given type. 2023-04-21 22:28:20 +04:00
coder2020official d1417e5616 Added the field web_app_name to the class WriteAccessAllowed. 2023-04-21 22:14:16 +04:00
_run a7cafd1f24
Update README.md 2023-04-21 21:27:08 +04:00
22 changed files with 4972 additions and 1772 deletions

22
.readthedocs.yaml Normal file
View File

@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt

View File

@ -10,7 +10,7 @@
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
<p align="center">Both synchronous and asynchronous.</p>
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#march-9-2023">6.6</a>!
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#april-21-2023">6.7</a>!
<h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
<h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
@ -891,5 +891,6 @@ Here are some examples of template:
* [Spot Seek Bot](https://t.me/SpotSeekBot) ([source](https://github.com/arashnm80/spot-seek-bot)) by [Arashnm80](https://github.com/arashnm80). This is a free & open source telegram bot for downloading tracks, albums or playlists from spotify.
* [CalendarIT Bot](https://t.me/calendarit_bot) ([source](https://github.com/codebyzen/CalendarIT_Telegram_Bot))by [CodeByZen](https://github.com/codebyzen). A simple, but extensible Python Telegram bot, can post acquainted with what is happening today, tomorrow or what happened 20 years ago to channel.
* [DownloadMusicBOT](https://github.com/fcoagz/DownloadMusicBOT) by *Francisco Griman* - It is a simple bot that downloads audio from YouTube videos on Telegram.
* [AwesomeChatGPTBot](https://github.com/Kourva/AwesomeChatGPTBot) - Simple ChatGTP-3.5 bot. It is FREE and can remember chat history for a while With pre-defined roles!
**Want to have your bot listed here? Just make a pull request. Only bots with public source code are accepted.**

View File

@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------
project = 'pyTelegramBotAPI Documentation'
copyright = '2022, coder2020official'
copyright = '2022-2023, coder2020official'
author = 'coder2020official'
# The full version, including alpha/beta/rc tags
release = '4.11.0'
release = '4.12.0'
# -- General configuration ---------------------------------------------------

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-02 19:24+0400\n"
"POT-Creation-Date: 2023-07-08 23:07+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -105,6 +105,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.delete_my_commands
#: telebot.async_telebot.AsyncTeleBot.delete_state
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_from_set
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set
#: telebot.async_telebot.AsyncTeleBot.delete_webhook
#: telebot.async_telebot.AsyncTeleBot.download_file
#: telebot.async_telebot.AsyncTeleBot.edit_chat_invite_link
@ -131,6 +132,9 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.get_game_high_scores
#: telebot.async_telebot.AsyncTeleBot.get_my_commands
#: telebot.async_telebot.AsyncTeleBot.get_my_default_administrator_rights
#: telebot.async_telebot.AsyncTeleBot.get_my_description
#: telebot.async_telebot.AsyncTeleBot.get_my_name
#: telebot.async_telebot.AsyncTeleBot.get_my_short_description
#: telebot.async_telebot.AsyncTeleBot.get_state
#: telebot.async_telebot.AsyncTeleBot.get_sticker_set
#: telebot.async_telebot.AsyncTeleBot.get_updates
@ -196,12 +200,20 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.set_chat_photo
#: telebot.async_telebot.AsyncTeleBot.set_chat_sticker_set
#: telebot.async_telebot.AsyncTeleBot.set_chat_title
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_game_score
#: telebot.async_telebot.AsyncTeleBot.set_my_commands
#: telebot.async_telebot.AsyncTeleBot.set_my_default_administrator_rights
#: telebot.async_telebot.AsyncTeleBot.set_my_description
#: telebot.async_telebot.AsyncTeleBot.set_my_name
#: telebot.async_telebot.AsyncTeleBot.set_my_short_description
#: telebot.async_telebot.AsyncTeleBot.set_state
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list
#: telebot.async_telebot.AsyncTeleBot.set_sticker_keywords
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position
#: telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title
#: telebot.async_telebot.AsyncTeleBot.set_update_listener
#: telebot.async_telebot.AsyncTeleBot.set_webhook
#: telebot.async_telebot.AsyncTeleBot.setup_middleware
@ -304,6 +316,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.delete_my_commands
#: telebot.async_telebot.AsyncTeleBot.delete_state
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_from_set
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set
#: telebot.async_telebot.AsyncTeleBot.delete_webhook
#: telebot.async_telebot.AsyncTeleBot.download_file
#: telebot.async_telebot.AsyncTeleBot.edit_chat_invite_link
@ -329,6 +342,9 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.get_game_high_scores
#: telebot.async_telebot.AsyncTeleBot.get_my_commands
#: telebot.async_telebot.AsyncTeleBot.get_my_default_administrator_rights
#: telebot.async_telebot.AsyncTeleBot.get_my_description
#: telebot.async_telebot.AsyncTeleBot.get_my_name
#: telebot.async_telebot.AsyncTeleBot.get_my_short_description
#: telebot.async_telebot.AsyncTeleBot.get_state
#: telebot.async_telebot.AsyncTeleBot.get_sticker_set
#: telebot.async_telebot.AsyncTeleBot.get_updates
@ -392,12 +408,20 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.set_chat_photo
#: telebot.async_telebot.AsyncTeleBot.set_chat_sticker_set
#: telebot.async_telebot.AsyncTeleBot.set_chat_title
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_game_score
#: telebot.async_telebot.AsyncTeleBot.set_my_commands
#: telebot.async_telebot.AsyncTeleBot.set_my_default_administrator_rights
#: telebot.async_telebot.AsyncTeleBot.set_my_description
#: telebot.async_telebot.AsyncTeleBot.set_my_name
#: telebot.async_telebot.AsyncTeleBot.set_my_short_description
#: telebot.async_telebot.AsyncTeleBot.set_state
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list
#: telebot.async_telebot.AsyncTeleBot.set_sticker_keywords
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position
#: telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title
#: telebot.async_telebot.AsyncTeleBot.set_update_listener
#: telebot.async_telebot.AsyncTeleBot.set_webhook
#: telebot.async_telebot.AsyncTeleBot.setup_middleware
@ -477,32 +501,45 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:1
msgid ""
"Use this method to add a new sticker to a set created by the bot. It's "
"required to pass `png_sticker` or `tgs_sticker`. Returns True on success."
"Use this method to add a new sticker to a set created by the bot. The "
"format of the added sticker must match the format of the other stickers "
"in the set. Emoji sticker sets can have up to 200 stickers. Animated and "
"video sticker sets can have up to 50 stickers. Static sticker sets can "
"have up to 120 stickers. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:5
msgid "Telegram documentation: https://core.telegram.org/bots/api#addstickertoset"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:7
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:7
msgid "User identifier of created sticker set owner"
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:8
msgid ""
"**_sticker, mask_position, emojis parameters are deprecated, use stickers"
" instead"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:10
msgid "Telegram documentation: https://core.telegram.org/bots/api#addstickertoset"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:12
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:10
msgid "User identifier of created sticker set owner"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:15
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set:3
#: telebot.async_telebot.AsyncTeleBot.get_sticker_set:5
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:6
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail:4
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list:4
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:6
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title:4
msgid "Sticker set name"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:13
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:18
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:18
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:21
msgid "One or more emoji corresponding to the sticker"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:16
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:21
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:21
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:24
msgid ""
"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 "
@ -512,36 +549,43 @@ msgid ""
"/form-data."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:21
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:26
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:26
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:29
msgid "TGS animation with the sticker, uploaded using multipart/form-data."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:24
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:29
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:29
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:32
msgid "WebM animation with the sticker, uploaded using multipart/form-data."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:27
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:40
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:32
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:42
msgid ""
"A JSON-serialized object for position where the mask should be placed on "
"faces"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:30
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:35
msgid ""
"A JSON-serialized list of 1-50 initial stickers to be added to the "
"sticker set"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:38
#: telebot.async_telebot.AsyncTeleBot.answer_callback_query:22
#: telebot.async_telebot.AsyncTeleBot.answer_inline_query:35
#: telebot.async_telebot.AsyncTeleBot.answer_inline_query:38
#: telebot.async_telebot.AsyncTeleBot.answer_pre_checkout_query:21
#: telebot.async_telebot.AsyncTeleBot.answer_shipping_query:18
#: telebot.async_telebot.AsyncTeleBot.close_forum_topic:13
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:43
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:56
#: telebot.async_telebot.AsyncTeleBot.delete_forum_topic:13
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_from_set:6
#: telebot.async_telebot.AsyncTeleBot.edit_forum_topic:22
#: telebot.async_telebot.AsyncTeleBot.reopen_forum_topic:13
#: telebot.async_telebot.AsyncTeleBot.set_sticker_keywords:11
#: telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set:11
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:15
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:15
#: telebot.async_telebot.AsyncTeleBot.unpin_all_forum_topic_messages:13
msgid "On success, True is returned."
msgstr ""
@ -568,6 +612,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.delete_message
#: telebot.async_telebot.AsyncTeleBot.delete_my_commands
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_from_set
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set
#: telebot.async_telebot.AsyncTeleBot.delete_webhook
#: telebot.async_telebot.AsyncTeleBot.download_file
#: telebot.async_telebot.AsyncTeleBot.edit_chat_invite_link
@ -627,11 +672,16 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.set_chat_photo
#: telebot.async_telebot.AsyncTeleBot.set_chat_sticker_set
#: telebot.async_telebot.AsyncTeleBot.set_chat_title
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_game_score
#: telebot.async_telebot.AsyncTeleBot.set_my_commands
#: telebot.async_telebot.AsyncTeleBot.set_my_default_administrator_rights
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list
#: telebot.async_telebot.AsyncTeleBot.set_sticker_keywords
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position
#: telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title
#: telebot.async_telebot.AsyncTeleBot.set_webhook
#: telebot.async_telebot.AsyncTeleBot.stop_message_live_location
#: telebot.async_telebot.AsyncTeleBot.stop_poll
@ -644,9 +694,9 @@ msgstr ""
msgid "Return type"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:31
#: of telebot.async_telebot.AsyncTeleBot.add_sticker_to_set:39
#: telebot.async_telebot.AsyncTeleBot.answer_callback_query:23
#: telebot.async_telebot.AsyncTeleBot.answer_inline_query:36
#: telebot.async_telebot.AsyncTeleBot.answer_inline_query:39
#: telebot.async_telebot.AsyncTeleBot.answer_pre_checkout_query:22
#: telebot.async_telebot.AsyncTeleBot.answer_shipping_query:19
#: telebot.async_telebot.AsyncTeleBot.approve_chat_join_request:15
@ -654,7 +704,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.ban_chat_sender_chat:17
#: telebot.async_telebot.AsyncTeleBot.close:9
#: telebot.async_telebot.AsyncTeleBot.close_forum_topic:14
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:44
#: telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:57
#: telebot.async_telebot.AsyncTeleBot.decline_chat_join_request:15
#: telebot.async_telebot.AsyncTeleBot.delete_chat_photo:13
#: telebot.async_telebot.AsyncTeleBot.delete_chat_sticker_set:11
@ -662,6 +712,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.delete_message:23
#: telebot.async_telebot.AsyncTeleBot.delete_my_commands:17
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_from_set:7
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set:7
#: telebot.async_telebot.AsyncTeleBot.delete_webhook:13
#: telebot.async_telebot.AsyncTeleBot.edit_forum_topic:23
#: telebot.async_telebot.AsyncTeleBot.leave_chat:8
@ -669,18 +720,23 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.pin_chat_message:19
#: telebot.async_telebot.AsyncTeleBot.promote_chat_member:61
#: telebot.async_telebot.AsyncTeleBot.reopen_forum_topic:14
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:48
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:61
#: telebot.async_telebot.AsyncTeleBot.send_chat_action:26
#: telebot.async_telebot.AsyncTeleBot.set_chat_administrator_custom_title:18
#: telebot.async_telebot.AsyncTeleBot.set_chat_description:14
#: telebot.async_telebot.AsyncTeleBot.set_chat_menu_button:15
#: telebot.async_telebot.AsyncTeleBot.set_chat_permissions:15
#: telebot.async_telebot.AsyncTeleBot.set_chat_permissions:21
#: telebot.async_telebot.AsyncTeleBot.set_chat_photo:16
#: telebot.async_telebot.AsyncTeleBot.set_chat_title:17
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail:11
#: telebot.async_telebot.AsyncTeleBot.set_my_commands:18
#: telebot.async_telebot.AsyncTeleBot.set_my_default_administrator_rights:18
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list:11
#: telebot.async_telebot.AsyncTeleBot.set_sticker_keywords:12
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position:12
#: telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set:12
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:16
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:16
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title:11
#: telebot.async_telebot.AsyncTeleBot.unban_chat_member:20
#: telebot.async_telebot.AsyncTeleBot.unban_chat_sender_chat:15
#: telebot.async_telebot.AsyncTeleBot.unpin_all_chat_messages:12
@ -795,6 +851,12 @@ msgid ""
"switch button"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.answer_inline_query:35
msgid ""
"A JSON-serialized object describing a button to be shown above inline "
"query results"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.answer_pre_checkout_query:1
msgid ""
"Once the user has confirmed their payment and shipping details, the Bot "
@ -920,7 +982,7 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.get_chat_member:8
#: telebot.async_telebot.AsyncTeleBot.get_user_profile_photos:6
#: telebot.async_telebot.AsyncTeleBot.promote_chat_member:11
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:11
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:14
#: telebot.async_telebot.AsyncTeleBot.set_chat_administrator_custom_title:10
#: telebot.async_telebot.AsyncTeleBot.unban_chat_member:13
msgid "Unique identifier of the target user"
@ -941,6 +1003,9 @@ msgstr ""
#: telebot.async_telebot.AsyncTeleBot.set_chat_title:16
#: telebot.async_telebot.AsyncTeleBot.set_my_commands:17
#: telebot.async_telebot.AsyncTeleBot.set_my_default_administrator_rights:17
#: telebot.async_telebot.AsyncTeleBot.set_my_description:12
#: telebot.async_telebot.AsyncTeleBot.set_my_name:12
#: telebot.async_telebot.AsyncTeleBot.set_my_short_description:12
#: telebot.async_telebot.AsyncTeleBot.set_webhook:46
#: telebot.async_telebot.AsyncTeleBot.unban_chat_sender_chat:14
#: telebot.async_telebot.AsyncTeleBot.unpin_all_chat_messages:11
@ -961,7 +1026,7 @@ msgid "Telegram documentation: https://core.telegram.org/bots/api#banchatmember"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.ban_chat_member:8
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:7
#: telebot.async_telebot.AsyncTeleBot.restrict_chat_member:10
msgid ""
"Unique identifier for the target group or username of the target "
"supergroup or channel (in the format @channelusername)"
@ -985,8 +1050,13 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.ban_chat_member:24
#: telebot.async_telebot.AsyncTeleBot.delete_chat_sticker_set:10
#: telebot.async_telebot.AsyncTeleBot.delete_message:22
#: telebot.async_telebot.AsyncTeleBot.delete_sticker_set:6
#: telebot.async_telebot.AsyncTeleBot.delete_webhook:12
#: telebot.async_telebot.AsyncTeleBot.send_chat_action:25
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail:10
#: telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list:10
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position:11
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_title:10
msgid "Returns True on success."
msgstr ""
@ -1394,21 +1464,21 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.copy_message:45
#: telebot.async_telebot.AsyncTeleBot.forward_message:26
#: telebot.async_telebot.AsyncTeleBot.reply_to:11
#: telebot.async_telebot.AsyncTeleBot.send_animation:63
#: telebot.async_telebot.AsyncTeleBot.send_audio:63
#: telebot.async_telebot.AsyncTeleBot.send_animation:66
#: telebot.async_telebot.AsyncTeleBot.send_audio:66
#: telebot.async_telebot.AsyncTeleBot.send_contact:44
#: telebot.async_telebot.AsyncTeleBot.send_dice:35
#: telebot.async_telebot.AsyncTeleBot.send_document:56
#: telebot.async_telebot.AsyncTeleBot.send_document:59
#: telebot.async_telebot.AsyncTeleBot.send_game:32
#: telebot.async_telebot.AsyncTeleBot.send_invoice:101
#: telebot.async_telebot.AsyncTeleBot.send_location:49
#: telebot.async_telebot.AsyncTeleBot.send_message:46
#: telebot.async_telebot.AsyncTeleBot.send_photo:48
#: telebot.async_telebot.AsyncTeleBot.send_poll:70
#: telebot.async_telebot.AsyncTeleBot.send_sticker:39
#: telebot.async_telebot.AsyncTeleBot.send_sticker:42
#: telebot.async_telebot.AsyncTeleBot.send_venue:57
#: telebot.async_telebot.AsyncTeleBot.send_video:64
#: telebot.async_telebot.AsyncTeleBot.send_video_note:48
#: telebot.async_telebot.AsyncTeleBot.send_video:67
#: telebot.async_telebot.AsyncTeleBot.send_video_note:51
#: telebot.async_telebot.AsyncTeleBot.send_voice:49
msgid "On success, the sent Message is returned."
msgstr ""
@ -1416,18 +1486,18 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.copy_message:46
#: telebot.async_telebot.AsyncTeleBot.forward_message:27
#: telebot.async_telebot.AsyncTeleBot.reply_to:12
#: telebot.async_telebot.AsyncTeleBot.send_animation:64
#: telebot.async_telebot.AsyncTeleBot.send_audio:64
#: telebot.async_telebot.AsyncTeleBot.send_animation:67
#: telebot.async_telebot.AsyncTeleBot.send_audio:67
#: telebot.async_telebot.AsyncTeleBot.send_contact:45
#: telebot.async_telebot.AsyncTeleBot.send_dice:36
#: telebot.async_telebot.AsyncTeleBot.send_document:57
#: telebot.async_telebot.AsyncTeleBot.send_document:60
#: telebot.async_telebot.AsyncTeleBot.send_location:50
#: telebot.async_telebot.AsyncTeleBot.send_message:47
#: telebot.async_telebot.AsyncTeleBot.send_photo:49
#: telebot.async_telebot.AsyncTeleBot.send_sticker:40
#: telebot.async_telebot.AsyncTeleBot.send_sticker:43
#: telebot.async_telebot.AsyncTeleBot.send_venue:58
#: telebot.async_telebot.AsyncTeleBot.send_video:65
#: telebot.async_telebot.AsyncTeleBot.send_video_note:49
#: telebot.async_telebot.AsyncTeleBot.send_video:68
#: telebot.async_telebot.AsyncTeleBot.send_video_note:52
msgid ":class:`telebot.types.Message`"
msgstr ""
@ -1680,7 +1750,13 @@ msgid ""
"https://core.telegram.org/bots/api#createnewstickerset"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:10
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:8
msgid ""
"Fields *_sticker are deprecated, pass a list of stickers to stickers "
"parameter instead."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:13
msgid ""
"Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., "
"animals). Can contain only English letters, digits and underscores. Must "
@ -1689,21 +1765,38 @@ msgid ""
"characters."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:15
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:18
msgid "Sticker set title, 1-64 characters"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:32
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:35
msgid ""
"Pass True, if a set of mask stickers should be created. Deprecated since "
"Bot API 6.2, use sticker_type instead."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:36
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:39
msgid ""
"Optional, Type of stickers in the set, pass “regular” or “mask”. Custom "
"emoji sticker sets can't be created via the Bot API at the moment. By "
"default, a regular sticker set is created."
"Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. "
"By default, a regular sticker set is created."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:45
msgid ""
"Pass True if stickers in the sticker set must be repainted to the color "
"of text when used in messages, the accent color if used as emoji status, "
"white on chat photos, or another appropriate color based on context; for "
"custom emoji sticker sets only"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:50
msgid "List of stickers to be added to the set"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.create_new_sticker_set:53
msgid ""
"Format of stickers in the set, must be one of “static”, “animated”, "
"“video”"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.decline_chat_join_request:1
@ -1846,6 +1939,10 @@ msgstr ""
msgid "File identifier of the sticker"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.delete_sticker_set:1
msgid "Use this method to delete a sticker set. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.delete_webhook:1
msgid ""
"Use this method to remove webhook integration if you decide to switch "
@ -2396,7 +2493,7 @@ msgid "File identifier"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_file:12
#: telebot.async_telebot.AsyncTeleBot.upload_sticker_file:14
#: telebot.async_telebot.AsyncTeleBot.upload_sticker_file:21
msgid ":class:`telebot.types.File`"
msgstr ""
@ -2457,7 +2554,7 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_game_high_scores:10
#: telebot.async_telebot.AsyncTeleBot.retrieve_data:3
#: telebot.async_telebot.AsyncTeleBot.set_game_score:5
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:9
#: telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:9
msgid "User identifier"
msgstr ""
@ -2518,6 +2615,49 @@ msgstr ""
msgid ":class:`telebot.types.ChatAdministratorRights`"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_description:1
msgid ""
"Use this method to get the current bot description for the given user "
"language. Returns BotDescription on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_description:4
#: telebot.async_telebot.AsyncTeleBot.get_my_short_description:4
msgid "A two-letter ISO 639-1 language code or an empty string"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_description:7
msgid ":class:`telebot.types.BotDescription`"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_name:1
msgid ""
"Use this method to get the current bot name for the given user language. "
"Returns BotName on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_name:4
msgid "Telegram documentation: https://core.telegram.org/bots/api#getmyname"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_name:6
msgid "Optional. A two-letter ISO 639-1 language code or an empty string"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_name:9
msgid ":class:`telebot.types.BotName`"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_short_description:1
msgid ""
"Use this method to get the current bot short description for the given "
"user language. Returns BotShortDescription on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_my_short_description:7
msgid ":class:`telebot.types.BotShortDescription`"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_state:1
msgid ""
"Gets current state of a user. Not recommended to use this method. But it "
@ -2589,7 +2729,7 @@ msgid "Array of string. List the types of updates you want your bot to receive."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_updates:21
msgid "Timeout in seconds for long polling."
msgid "Timeout in seconds for request."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.get_updates:24
@ -3178,61 +3318,85 @@ msgid ""
"https://core.telegram.org/bots/api#restrictchatmember"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:14
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:8
msgid ""
"Individual parameters are deprecated and will be removed, use "
"'permissions' instead"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:17
msgid ""
"Date when restrictions will be lifted for the user, unix time. If user is"
" restricted for more than 366 days or less than 30 seconds from the "
"current time, they are considered to be restricted forever"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:19
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:22
msgid ""
"Pass True, if the user can send text messages, contacts, locations and "
"venues"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:22
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:25
msgid ""
"Pass True, if the user can send audios, documents, photos, videos, video "
"notes and voice notes, implies can_send_messages"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:26
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:29
msgid "Pass True, if the user is allowed to send polls, implies can_send_messages"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:29
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:32
msgid ""
"Pass True, if the user can send animations, games, stickers and use "
"inline bots, implies can_send_media_messages"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:32
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:35
msgid ""
"Pass True, if the user may add web page previews to their messages, "
"implies can_send_media_messages"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:36
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:39
msgid ""
"Pass True, if the user is allowed to change the chat title, photo and "
"other settings. Ignored in public supergroups"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:40
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:43
msgid ""
"Pass True, if the user is allowed to invite new users to the chat, "
"implies can_invite_users"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:44
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:47
msgid ""
"Pass True, if the user is allowed to pin messages. Ignored in public "
"supergroups"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:47
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:50
#: telebot.async_telebot.AsyncTeleBot.set_chat_permissions:14
msgid ""
"Pass True if chat permissions are set independently. Otherwise, the "
"can_send_other_messages and can_add_web_page_previews permissions will "
"imply the can_send_messages, can_send_audios, can_send_documents, "
"can_send_photos, can_send_videos, can_send_video_notes, and "
"can_send_voice_notes permissions; the can_send_polls permission will "
"imply the can_send_messages permission."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:56
msgid ""
"Pass ChatPermissions object to set all permissions at once. Use this "
"parameter instead of passing all boolean parameters to avoid backward "
"compatibility problems in future."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.restrict_chat_member:60
#: telebot.async_telebot.AsyncTeleBot.set_chat_permissions:20
#: telebot.async_telebot.AsyncTeleBot.unban_chat_member:19
msgid "True on success"
msgstr ""
@ -3275,27 +3439,27 @@ msgstr ""
msgid "IP address to listen to. Defaults to 0.0.0.0"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:5
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:4
msgid "A port which will be used to listen to webhooks."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:6
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:5
msgid "Path to the webhook. Defaults to /token"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:7
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:6
msgid "Path to the certificate file."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:8
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:7
msgid "Path to the certificate key file."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:9
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:8
msgid "Webhook URL."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:10
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:9
msgid ""
"Maximum allowed number of simultaneous HTTPS connections to the webhook "
"for update delivery, 1-100. Defaults to 40. Use lower values to limit the"
@ -3303,7 +3467,7 @@ msgid ""
"throughput."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:11
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:10
msgid ""
"A JSON-serialized list of the update types you want your bot to receive. "
"For example, specify [“message”, “edited_channel_post”, “callback_query”]"
@ -3313,24 +3477,32 @@ msgid ""
" be used."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:12
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:11
msgid ""
"The fixed IP address which will be used to send webhook requests instead "
"of the IP address resolved through DNS"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:13
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:12
msgid "Pass True to drop all pending updates"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:14
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:13
msgid "Integer. Request connection timeout"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:15
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:14
msgid "Secret token to be used to verify the webhook request."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:15
msgid "Length of a secret token, defaults to 20"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.run_webhooks:16
msgid "Debug mode, defaults to False"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.send_animation:1
msgid ""
"Use this method to send animation files (GIF or H.264/MPEG-4 AVC video "
@ -3402,6 +3574,14 @@ msgstr ""
msgid "Pass True, if the animation should be sent as a spoiler"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.send_animation:63
#: telebot.async_telebot.AsyncTeleBot.send_audio:63
#: telebot.async_telebot.AsyncTeleBot.send_document:56
#: telebot.async_telebot.AsyncTeleBot.send_video:64
#: telebot.async_telebot.AsyncTeleBot.send_video_note:48
msgid "Deprecated. Use thumbnail instead"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.send_audio:1
msgid ""
"Use this method to send audio files, if you want Telegram clients to "
@ -3953,6 +4133,10 @@ msgstr ""
msgid "to disable the notification"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.send_sticker:39
msgid "Emoji associated with the sticker; only for just uploaded stickers"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.send_venue:1
msgid ""
"Use this method to send information about a venue. On success, the sent "
@ -4243,6 +4427,20 @@ msgstr ""
msgid "New chat title, 1-255 characters"
msgstr ""
#: of
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail:1
msgid ""
"Use this method to set the thumbnail of a custom emoji sticker set. "
"Returns True on success."
msgstr ""
#: of
#: telebot.async_telebot.AsyncTeleBot.set_custom_emoji_sticker_set_thumbnail:7
msgid ""
"Custom emoji identifier of a sticker from the sticker set; pass an empty "
"string to drop the thumbnail and use the first sticker as the thumbnail."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_game_score:1
msgid "Sets the value of points in the game to a specific user."
msgstr ""
@ -4312,6 +4510,65 @@ msgid ""
"groups and supergroups will be changed."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_description:1
msgid ""
"Use this method to change the bot's description, which is shown in the "
"chat with the bot if the chat is empty. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_description:5
msgid ""
"New bot description; 0-512 characters. Pass an empty string to remove the"
" dedicated description for the given language."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_description:8
msgid ""
"A two-letter ISO 639-1 language code. If empty, the description will be "
"applied to all users for whose language there is no dedicated "
"description."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_name:1
msgid "Use this method to change the bot's name. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_name:3
msgid "Telegram documentation: https://core.telegram.org/bots/api#setmyname"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_name:5
msgid ""
"Optional. New bot name; 0-64 characters. Pass an empty string to remove "
"the dedicated name for the given language."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_name:8
msgid ""
"Optional. A two-letter ISO 639-1 language code. If empty, the name will "
"be shown to all users for whose language there is no dedicated name."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_short_description:1
msgid ""
"Use this method to change the bot's short description, which is shown on "
"the bot's profile page and is sent together with the link when users "
"share the bot. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_short_description:5
msgid ""
"New short description for the bot; 0-120 characters. Pass an empty string"
" to remove the dedicated short description for the given language."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_my_short_description:8
msgid ""
"A two-letter ISO 639-1 language code. If empty, the short description "
"will be applied to all users for whose language there is no dedicated "
"short description."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_state:1
msgid "Sets a new state of a user."
msgstr ""
@ -4328,6 +4585,47 @@ msgstr ""
msgid "new state. can be string, integer, or :class:`telebot.types.State`"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list:1
msgid ""
"Use this method to set the emoji list of a sticker set. Returns True on "
"success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_emoji_list:7
msgid "List of emojis"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_keywords:1
msgid ""
"Use this method to change search keywords assigned to a regular or custom"
" emoji sticker. The sticker must belong to a sticker set created by the "
"bot. Returns True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_keywords:5
#: telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position:5
msgid "File identifier of the sticker."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_keywords:8
msgid ""
"A JSON-serialized list of 0-20 search keywords for the sticker with total"
" length of up to 64 characters"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position:1
msgid ""
"Use this method to change the mask position of a mask sticker. The "
"sticker must belong to a sticker set that was created by the bot. Returns"
" True on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_mask_position:8
msgid ""
"A JSON-serialized object for position where the mask should be placed on "
"faces."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_position_in_set:1
msgid ""
"Use this method to move a sticker in a set created by the bot to a "
@ -4344,19 +4642,47 @@ msgstr ""
msgid "New sticker position in the set, zero-based"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:1
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:1
msgid ""
"Use this method to set the thumbnail of a sticker set. Animated "
"thumbnails can be set for animated sticker sets only. Returns True on "
"success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumb:4
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:4
msgid ""
"Telegram documentation: "
"https://core.telegram.org/bots/api#setstickersetthumb"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_thumbnail:12
msgid ""
"A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in "
"size and have a width and height of exactly 100px, or a .TGS animation "
"with a 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. More information on Sending Files ». Animated "
"and video sticker set thumbnails can't be uploaded via HTTP URL. If "
"omitted, then the thumbnail is dropped and the first sticker is used as "
"the thumbnail."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_title:1
msgid ""
"Use this method to set the title of a created sticker set. Returns True "
"on success."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_sticker_set_title:7
msgid "New sticker set title"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.set_update_listener:1
msgid "Update listener is a function that gets any update."
msgstr ""
@ -4662,12 +4988,23 @@ msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.upload_sticker_file:9
msgid ""
"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."
"DEPRECATED: 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."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.upload_sticker_file:13
msgid ""
"A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See "
"https://core.telegram.org/stickers for technical requirements. More "
"information on Sending Files »"
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.upload_sticker_file:17
msgid "One of \"static\", \"animated\", \"video\"."
msgstr ""
#: of telebot.async_telebot.AsyncTeleBot.upload_sticker_file:20
msgid "On success, the sent file is returned."
msgstr ""
@ -4913,3 +5250,31 @@ msgstr ""
#~ "character long"
#~ msgstr ""
#~ msgid ""
#~ "Use this method to add a new "
#~ "sticker to a set created by the"
#~ " bot. It's required to pass "
#~ "`png_sticker` or `tgs_sticker`. Returns True"
#~ " on success."
#~ msgstr ""
#~ msgid ""
#~ "Optional, Type of stickers in the "
#~ "set, pass “regular” or “mask”. Custom"
#~ " emoji sticker sets can't be created"
#~ " via the Bot API at the moment."
#~ " By default, a regular sticker set"
#~ " is created."
#~ msgstr ""
#~ msgid "Timeout in seconds for long polling."
#~ msgstr ""
#~ msgid ""
#~ "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."
#~ msgstr ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"POT-Creation-Date: 2023-07-08 23:07+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,19 +18,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../util.rst:3
#: ../../source/util.rst:3
msgid "Utils"
msgstr ""
#: ../../util.rst:5
#: ../../source/util.rst:5
msgid "Utils in pyTelegramBotAPI"
msgstr ""
#: ../../util.rst:5
#: ../../source/util.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, utils, guide"
msgstr ""
#: ../../util.rst:11
#: ../../source/util.rst:11
msgid "util file"
msgstr ""
@ -40,9 +40,10 @@ msgid ""
"error. Example:"
msgstr ""
#: of telebot.util.antiflood telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_bytes telebot.util.is_command
#: telebot.util.is_dict telebot.util.is_pil_image
#: of telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
@ -54,28 +55,33 @@ msgid "The function to call"
msgstr ""
#: of telebot.util.antiflood:13
msgid "The arguments to pass to the function"
msgid "Number of retries to send"
msgstr ""
#: of telebot.util.antiflood:16
msgid "The keyword arguments to pass to the function"
msgstr ""
#: of telebot.util.antiflood telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.generate_random_token
#: telebot.util.is_bytes telebot.util.is_command telebot.util.is_dict
#: telebot.util.is_pil_image telebot.util.parse_web_app_data
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link telebot.util.validate_web_app_data
#: telebot.util.webhook_google_functions
msgid "Returns"
msgid "The arguments to pass to the function"
msgstr ""
#: of telebot.util.antiflood:19
msgid "The keyword arguments to pass to the function"
msgstr ""
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Returns"
msgstr ""
#: of telebot.util.antiflood:22
msgid "None"
msgstr ""
#: of telebot.util.chunks:1
#: of telebot.service_utils.chunks:1
msgid "Yield successive n-sized chunks from lst."
msgstr ""
@ -117,9 +123,10 @@ msgstr ""
msgid "the arguments if `text` is a command (according to is_command), else None."
msgstr ""
#: of telebot.util.extract_arguments telebot.util.extract_command
#: telebot.util.generate_random_token telebot.util.is_bytes
#: telebot.util.is_command telebot.util.is_dict telebot.util.is_pil_image
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link
msgid "Return type"
@ -143,35 +150,35 @@ msgstr ""
msgid "the command if `text` is a command (according to is_command), else None."
msgstr ""
#: of telebot.util.generate_random_token:1
#: of telebot.service_utils.generate_random_token:1
msgid ""
"Generates a random token consisting of letters and digits, 16 characters "
"long."
msgstr ""
#: of telebot.util.generate_random_token:3
#: of telebot.service_utils.generate_random_token:3
msgid "a random token"
msgstr ""
#: of telebot.util.generate_random_token:4 telebot.util.user_link:22
#: of telebot.service_utils.generate_random_token:4 telebot.util.user_link:22
msgid ":obj:`str`"
msgstr ""
#: of telebot.util.is_bytes:1
#: of telebot.service_utils.is_bytes:1
msgid "Returns True if the given object is a bytes object."
msgstr ""
#: of telebot.util.is_bytes:3 telebot.util.is_dict:3
#: telebot.util.is_pil_image:3
#: of telebot.service_utils.is_bytes:3 telebot.service_utils.is_dict:3
#: telebot.service_utils.is_pil_image:3
msgid "object to be checked"
msgstr ""
#: of telebot.util.is_bytes:6
#: of telebot.service_utils.is_bytes:6
msgid "True if the given object is a bytes object."
msgstr ""
#: of telebot.util.is_bytes:7 telebot.util.is_command:7 telebot.util.is_dict:7
#: telebot.util.is_pil_image:7
#: of telebot.service_utils.is_bytes:7 telebot.service_utils.is_dict:7
#: telebot.service_utils.is_pil_image:7 telebot.util.is_command:7
msgid ":obj:`bool`"
msgstr ""
@ -189,23 +196,23 @@ msgstr ""
msgid "True if `text` is a command, else False."
msgstr ""
#: of telebot.util.is_dict:1
#: of telebot.service_utils.is_dict:1
msgid "Returns True if the given object is a dictionary."
msgstr ""
#: of telebot.util.is_dict:6
#: of telebot.service_utils.is_dict:6
msgid "True if the given object is a dictionary."
msgstr ""
#: of telebot.util.is_pil_image:1
#: of telebot.service_utils.is_pil_image:1
msgid "Returns True if the given object is a PIL.Image.Image object."
msgstr ""
#: of telebot.util.is_pil_image:6
#: of telebot.service_utils.is_pil_image:6
msgid "True if the given object is a PIL.Image.Image object."
msgstr ""
#: of telebot.util.is_string:1
#: of telebot.service_utils.is_string:1
msgid "Returns True if the given object is a string."
msgstr ""
@ -240,21 +247,21 @@ msgstr ""
msgid "Using quick_markup:"
msgstr ""
#: of telebot.util.quick_markup:29
#: of telebot.util.quick_markup:31
msgid ""
"a dict containing all buttons to create in this format: {text: kwargs} "
"{str:}"
msgstr ""
#: of telebot.util.quick_markup:32
msgid "int row width"
#: of telebot.util.quick_markup:34
msgid "number of :class:`telebot.types.InlineKeyboardButton` objects on each row"
msgstr ""
#: of telebot.util.quick_markup:35
#: of telebot.util.quick_markup:37
msgid "InlineKeyboardMarkup"
msgstr ""
#: of telebot.util.quick_markup:36
#: of telebot.util.quick_markup:38
msgid ":obj:`types.InlineKeyboardMarkup`"
msgstr ""
@ -343,3 +350,6 @@ msgstr ""
msgid "The response object"
msgstr ""
#~ msgid "int row width"
#~ msgstr ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"POT-Creation-Date: 2023-07-08 23:07+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,19 +18,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../util.rst:3
#: ../../source/util.rst:3
msgid "Utils"
msgstr "Утилиты"
#: ../../util.rst:5
#: ../../source/util.rst:5
msgid "Utils in pyTelegramBotAPI"
msgstr "Утилиты в pyTelegramBotAPI"
#: ../../util.rst:5
#: ../../source/util.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, utils, guide"
msgstr "ptba, pytba, pyTelegramBotAPI, утилиты, гайд"
#: ../../util.rst:11
#: ../../source/util.rst:11
msgid "util file"
msgstr "Файл util"
@ -38,11 +38,14 @@ msgstr "Файл util"
msgid ""
"Use this function inside loops in order to avoid getting TooManyRequests "
"error. Example:"
msgstr "Используйте эту функцию в циклах, чтобы избежать ошибки TooManyRequests. Пример:"
msgstr ""
"Используйте эту функцию в циклах, чтобы избежать ошибки TooManyRequests. "
"Пример:"
#: of telebot.util.antiflood telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_bytes telebot.util.is_command
#: telebot.util.is_dict telebot.util.is_pil_image
#: of telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
@ -54,28 +57,33 @@ msgid "The function to call"
msgstr "Вызываемая функция"
#: of telebot.util.antiflood:13
msgid "Number of retries to send"
msgstr ""
#: of telebot.util.antiflood:16
msgid "The arguments to pass to the function"
msgstr "Аргументы, для передачи в функцию"
#: of telebot.util.antiflood:16
#: of telebot.util.antiflood:19
msgid "The keyword arguments to pass to the function"
msgstr "Именованные аргументы для передачи в функцию"
#: of telebot.util.antiflood telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.generate_random_token
#: telebot.util.is_bytes telebot.util.is_command telebot.util.is_dict
#: telebot.util.is_pil_image telebot.util.parse_web_app_data
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link telebot.util.validate_web_app_data
#: telebot.util.webhook_google_functions
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Returns"
msgstr ""
#: of telebot.util.antiflood:19
#: of telebot.util.antiflood:22
msgid "None"
msgstr ""
#: of telebot.util.chunks:1
#: of telebot.service_utils.chunks:1
msgid "Yield successive n-sized chunks from lst."
msgstr "Генерирует последовательные части списка, состоящие из n элементов."
@ -91,8 +99,9 @@ msgstr "Содержит все виды сервисных сообщений,
msgid ""
"Replaces the following chars in `text` ('&' with '&amp;', '<' with '&lt;'"
" and '>' with '&gt;')."
msgstr "Заменяет следующие символы в `text` ('&' на '&amp;', '<' на '&lt;'"
" и '>' на '&gt;')."
msgstr ""
"Заменяет следующие символы в `text` ('&' на '&amp;', '<' на '&lt;' и '>' "
"на '&gt;')."
#: of telebot.util.escape:3
msgid "the text to escape"
@ -116,11 +125,14 @@ msgstr "Строка для извлечения аргументов коман
#: of telebot.util.extract_arguments:13
msgid "the arguments if `text` is a command (according to is_command), else None."
msgstr "Аргументы, если `text` является командой (согласно is_command), в остальных случаях None."
msgstr ""
"Аргументы, если `text` является командой (согласно is_command), в "
"остальных случаях None."
#: of telebot.util.extract_arguments telebot.util.extract_command
#: telebot.util.generate_random_token telebot.util.is_bytes
#: telebot.util.is_command telebot.util.is_dict telebot.util.is_pil_image
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link
msgid "Return type"
@ -135,8 +147,9 @@ msgid ""
"Extracts the command from `text` (minus the '/') if `text` is a command "
"(see is_command). If `text` is not a command, this function returns None."
msgstr ""
"Извлекает команду из `text` (исключает '/') если `text` является командой "
"(см. is_command). Если `text` не является командой, эта функция возвращает None."
"Извлекает команду из `text` (исключает '/') если `text` является командой"
" (см. is_command). Если `text` не является командой, эта функция "
"возвращает None."
#: of telebot.util.extract_command:12
msgid "String to extract the command from"
@ -144,37 +157,41 @@ msgstr "Строка, из которой нужно извлечь команд
#: of telebot.util.extract_command:15
msgid "the command if `text` is a command (according to is_command), else None."
msgstr "Команда, если `text` является командой (согласно is_command), в остальных случаях None."
msgstr ""
"Команда, если `text` является командой (согласно is_command), в остальных"
" случаях None."
#: of telebot.util.generate_random_token:1
#: of telebot.service_utils.generate_random_token:1
msgid ""
"Generates a random token consisting of letters and digits, 16 characters "
"long."
msgstr "Генерирует рандомный токен, состоящий из латинских букв и цифр длиной 16 символов."
msgstr ""
"Генерирует рандомный токен, состоящий из латинских букв и цифр длиной 16 "
"символов."
#: of telebot.util.generate_random_token:3
#: of telebot.service_utils.generate_random_token:3
msgid "a random token"
msgstr "Сгенерированный токен"
#: of telebot.util.generate_random_token:4 telebot.util.user_link:22
#: of telebot.service_utils.generate_random_token:4 telebot.util.user_link:22
msgid ":obj:`str`"
msgstr ""
#: of telebot.util.is_bytes:1
#: of telebot.service_utils.is_bytes:1
msgid "Returns True if the given object is a bytes object."
msgstr "Возвращает True если полученный объект является bytes."
#: of telebot.util.is_bytes:3 telebot.util.is_dict:3
#: telebot.util.is_pil_image:3
#: of telebot.service_utils.is_bytes:3 telebot.service_utils.is_dict:3
#: telebot.service_utils.is_pil_image:3
msgid "object to be checked"
msgstr "Объект для проверки"
#: of telebot.util.is_bytes:6
#: of telebot.service_utils.is_bytes:6
msgid "True if the given object is a bytes object."
msgstr "True, если полученный объект является bytes."
#: of telebot.util.is_bytes:7 telebot.util.is_command:7 telebot.util.is_dict:7
#: telebot.util.is_pil_image:7
#: of telebot.service_utils.is_bytes:7 telebot.service_utils.is_dict:7
#: telebot.service_utils.is_pil_image:7 telebot.util.is_command:7
msgid ":obj:`bool`"
msgstr ""
@ -183,8 +200,8 @@ msgid ""
"Checks if `text` is a command. Telegram chat commands start with the '/' "
"character."
msgstr ""
"Проверяет, является ли `text` командой. Команды в Telegram начинаются "
"с символа '/'."
"Проверяет, является ли `text` командой. Команды в Telegram начинаются с "
"символа '/'."
#: of telebot.util.is_command:3
msgid "Text to check."
@ -194,23 +211,23 @@ msgstr "Текст для проверки."
msgid "True if `text` is a command, else False."
msgstr "True, если `text` является командой, иначе False."
#: of telebot.util.is_dict:1
#: of telebot.service_utils.is_dict:1
msgid "Returns True if the given object is a dictionary."
msgstr "Возвращает True, если полученный объект является словарём (dict)."
#: of telebot.util.is_dict:6
#: of telebot.service_utils.is_dict:6
msgid "True if the given object is a dictionary."
msgstr "True, если полученный объект является словарём (dict)."
#: of telebot.util.is_pil_image:1
#: of telebot.service_utils.is_pil_image:1
msgid "Returns True if the given object is a PIL.Image.Image object."
msgstr "Возвращает True, если полученный объект является PIL.Image.Image."
#: of telebot.util.is_pil_image:6
#: of telebot.service_utils.is_pil_image:6
msgid "True if the given object is a PIL.Image.Image object."
msgstr "True, если полученный объект является PIL.Image.Image."
#: of telebot.util.is_string:1
#: of telebot.service_utils.is_string:1
msgid "Returns True if the given object is a string."
msgstr "Возвращает True, если полученный объект является строкой (str)."
@ -236,9 +253,9 @@ msgid ""
"is useful to avoid always typing 'btn1 = InlineKeyboardButton(...)' 'btn2"
" = InlineKeyboardButton(...)'"
msgstr ""
"Возвращает reply markup из словаря следующего формата: {'text': kwargs}. Удобно "
"использовать вместо постоянного использования 'btn1 = InlineKeyboardButton(...)' 'btn2"
" = InlineKeyboardButton(...)'"
"Возвращает reply markup из словаря следующего формата: {'text': kwargs}. "
"Удобно использовать вместо постоянного использования 'btn1 = "
"InlineKeyboardButton(...)' 'btn2 = InlineKeyboardButton(...)'"
#: of telebot.util.quick_markup:4 telebot.util.user_link:5
msgid "Example:"
@ -248,7 +265,7 @@ msgstr "Пример:"
msgid "Using quick_markup:"
msgstr "Используя quick_markup:"
#: of telebot.util.quick_markup:29
#: of telebot.util.quick_markup:31
msgid ""
"a dict containing all buttons to create in this format: {text: kwargs} "
"{str:}"
@ -256,15 +273,15 @@ msgstr ""
"Словарь, содержащий все кнопки для создания reply markup в следующем "
"формате: {text: kwargs} {str:}"
#: of telebot.util.quick_markup:32
msgid "int row width"
msgstr "Количество кнопок в одной строке, int"
#: of telebot.util.quick_markup:34
msgid "number of :class:`telebot.types.InlineKeyboardButton` objects on each row"
msgstr ""
#: of telebot.util.quick_markup:35
#: of telebot.util.quick_markup:37
msgid "InlineKeyboardMarkup"
msgstr ""
#: of telebot.util.quick_markup:36
#: of telebot.util.quick_markup:38
msgid ":obj:`types.InlineKeyboardMarkup`"
msgstr ""
@ -276,10 +293,11 @@ msgid ""
" `chars_per_string` = 4096. Splits by '\\n', '. ' or ' ' in exactly this "
"priority."
msgstr ""
"Разбивает строку на несколько, каждая из которых будет не длиннее `characters_per_string`. "
"Удобно использовать для разбиения одного гигантского сообщения на несколько. "
"Если `chars_per_string` > 4096: `chars_per_string` = 4096. Разбивает строку по '\\n', '. ' или ' ' "
"именно в таком порядке."
"Разбивает строку на несколько, каждая из которых будет не длиннее "
"`characters_per_string`. Удобно использовать для разбиения одного "
"гигантского сообщения на несколько. Если `chars_per_string` > 4096: "
"`chars_per_string` = 4096. Разбивает строку по '\\n', '. ' или ' ' именно"
" в таком порядке."
#: of telebot.util.smart_split:6 telebot.util.split_string:4
msgid "The text to split"
@ -287,7 +305,9 @@ msgstr "Текст для разбиения"
#: of telebot.util.smart_split:9
msgid "The number of maximum characters per part the text is split to."
msgstr "Максимальное количество символов в части текста, на которые он будет разбит."
msgstr ""
"Максимальное количество символов в части текста, на которые он будет "
"разбит."
#: of telebot.util.smart_split:12 telebot.util.split_string:10
msgid "The splitted text as a list of strings."
@ -303,8 +323,9 @@ msgid ""
"`chars_per_string` characters per string. This is very useful for "
"splitting one giant message into multiples."
msgstr ""
"Разбивает одну строку на несколько, каждая из которых будет не длиннее `characters_per_string`. "
"Удобно использовать для разбиения одного гигантского сообщения на несколько."
"Разбивает одну строку на несколько, каждая из которых будет не длиннее "
"`characters_per_string`. Удобно использовать для разбиения одного "
"гигантского сообщения на несколько."
#: of telebot.util.split_string:7
msgid "The number of characters per line the text is split into."
@ -312,15 +333,17 @@ msgstr "Количество символов в одной строке, на
#: ../../docstring of telebot.util.update_types:1
msgid "All update types, should be used for allowed_updates parameter in polling."
msgstr "Все виды апдейтов, рекомендуется использовать в качестве параметра allowed_updates функции polling."
msgstr ""
"Все виды апдейтов, рекомендуется использовать в качестве параметра "
"allowed_updates функции polling."
#: of telebot.util.user_link:1
msgid ""
"Returns an HTML user link. This is useful for reports. Attention: Don't "
"forget to set parse_mode to 'HTML'!"
msgstr ""
"Возвращает HTML ссылку на пользователя. Удобно использовать для отчетов. Важно: Не "
"забудьте установить значение 'HTML' в parse_mode!"
"Возвращает HTML ссылку на пользователя. Удобно использовать для отчетов. "
"Важно: Не забудьте установить значение 'HTML' в parse_mode!"
#: of telebot.util.user_link:11
msgid ""
@ -328,9 +351,10 @@ msgid ""
"links, and etc.) This method is kept for backward compatibility, and it "
"is recommended to use formatting.* for more options."
msgstr ""
"Вы можете использовать formatting.* во всех остальных вариантах форматирования(bold, italic, "
"links, и прочее). Этот метод сохранён для обратной совместимости, рекомендуется "
"использовать formatting.* для большего количества вариантов."
"Вы можете использовать formatting.* во всех остальных вариантах "
"форматирования(bold, italic, links, и прочее). Этот метод сохранён для "
"обратной совместимости, рекомендуется использовать formatting.* для "
"большего количества вариантов."
#: of telebot.util.user_link:15
msgid "the user (not the user_id)"
@ -364,3 +388,6 @@ msgstr "HTTP-запрос"
msgid "The response object"
msgstr "Объект, полученный в качестве ответа"
#~ msgid "int row width"
#~ msgstr "Количество кнопок в одной строке, int"

View File

@ -1,4 +1,4 @@
pytest
requests==2.20.0
requests==2.31.0
wheel==0.38.1
aiohttp>=3.8.0,<3.9.0

View File

@ -3443,6 +3443,40 @@ class TeleBot:
"""
result = apihelper.get_my_commands(self.token, scope, language_code)
return [types.BotCommand.de_json(cmd) for cmd in result]
def set_my_name(self, name: Optional[str]=None, language_code: Optional[str]=None):
"""
Use this method to change the bot's name. Returns True on success.
Telegram documentation: https://core.telegram.org/bots/api#setmyname
:param name: Optional. New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
:type name: :obj:`str`
:param language_code: Optional. A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose
language there is no dedicated name.
:type language_code: :obj:`str`
:return: True on success.
"""
return apihelper.set_my_name(self.token, name, language_code)
def get_my_name(self, language_code: Optional[str]=None):
"""
Use this method to get the current bot name for the given user language.
Returns BotName on success.
Telegram documentation: https://core.telegram.org/bots/api#getmyname
:param language_code: Optional. A two-letter ISO 639-1 language code or an empty string
:type language_code: :obj:`str`
:return: :class:`telebot.types.BotName`
"""
result = apihelper.get_my_name(self.token, language_code)
return types.BotName.de_json(result)
def set_my_description(self, description: Optional[str]=None, language_code: Optional[str]=None):
"""
@ -3450,6 +3484,8 @@ class TeleBot:
the chat with the bot if the chat is empty.
Returns True on success.
Telegram documentation: https://core.telegram.org/bots/api#setmydescription
:param description: New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
:type description: :obj:`str`
@ -3467,6 +3503,8 @@ class TeleBot:
Use this method to get the current bot description for the given user language.
Returns BotDescription on success.
Telegram documentation: https://core.telegram.org/bots/api#getmydescription
:param language_code: A two-letter ISO 639-1 language code or an empty string
:type language_code: :obj:`str`
@ -3481,6 +3519,8 @@ class TeleBot:
is sent together with the link when users share the bot.
Returns True on success.
Telegram documentation: https://core.telegram.org/bots/api#setmyshortdescription
:param short_description: New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
:type short_description: :obj:`str`
@ -3498,6 +3538,8 @@ class TeleBot:
Use this method to get the current bot short description for the given user language.
Returns BotShortDescription on success.
Telegram documentation: https://core.telegram.org/bots/api#getmyshortdescription
:param language_code: A two-letter ISO 639-1 language code or an empty string
:type language_code: :obj:`str`
@ -4479,7 +4521,8 @@ class TeleBot:
is_personal: Optional[bool]=None,
next_offset: Optional[str]=None,
switch_pm_text: Optional[str]=None,
switch_pm_parameter: Optional[str]=None) -> bool:
switch_pm_parameter: Optional[str]=None,
button: Optional[types.InlineQueryResultsButton]=None) -> bool:
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
@ -4515,11 +4558,18 @@ class TeleBot:
:param switch_pm_text: Parameter for the start message sent to the bot when user presses the switch button
:type switch_pm_text: :obj:`str`
:param button: A JSON-serialized object describing a button to be shown above inline query results
:type button: :obj:`types.InlineQueryResultsButton`
:return: On success, True is returned.
:rtype: :obj:`bool`
"""
if not button and (switch_pm_text or switch_pm_parameter):
logger.warning("switch_pm_text and switch_pm_parameter are deprecated for answer_inline_query. Use button instead.")
button = types.InlineQueryResultsButton(text=switch_pm_text, start_parameter=switch_pm_parameter)
return apihelper.answer_inline_query(self.token, inline_query_id, results, cache_time, is_personal, next_offset,
switch_pm_text, switch_pm_parameter)
button)
def answer_callback_query(
self, callback_query_id: int,
@ -6548,7 +6598,7 @@ class TeleBot:
Registers chat member handler.
:param callback: function to be called
:type callback: :obj:`function``
:type callback: :obj:`function`
:param func: Function executed as a filter
:type func: :obj:`function`

View File

@ -1196,6 +1196,22 @@ def get_my_commands(token, scope=None, language_code=None):
payload['language_code'] = language_code
return _make_request(token, method_url, params=payload)
def set_my_name(token, name=None, language_code=None):
method_url = r'setMyName'
payload = {}
if name is not None:
payload['name'] = name
if language_code is not None:
payload['language_code'] = language_code
return _make_request(token, method_url, params=payload, method='post')
def get_my_name(token, language_code=None):
method_url = r'getMyName'
payload = {}
if language_code is not None:
payload['language_code'] = language_code
return _make_request(token, method_url, params=payload)
def set_chat_menu_button(token, chat_id=None, menu_button=None):
method_url = r'setChatMenuButton'
payload = {}
@ -1598,7 +1614,7 @@ def answer_callback_query(token, callback_query_id, text=None, show_alert=None,
def answer_inline_query(token, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
button=None):
method_url = 'answerInlineQuery'
payload = {'inline_query_id': inline_query_id, 'results': _convert_list_json_serializable(results)}
if cache_time is not None:
@ -1607,10 +1623,8 @@ def answer_inline_query(token, inline_query_id, results, cache_time=None, is_per
payload['is_personal'] = is_personal
if next_offset is not None:
payload['next_offset'] = next_offset
if switch_pm_text:
payload['switch_pm_text'] = switch_pm_text
if switch_pm_parameter:
payload['switch_pm_parameter'] = switch_pm_parameter
if button is not None:
payload["button"] = button.to_json()
return _make_request(token, method_url, params=payload, method='post')

View File

@ -16,7 +16,7 @@ import telebot.types
from telebot.asyncio_storage import StateMemoryStorage, StatePickleStorage, StateStorageBase
from telebot.asyncio_handler_backends import BaseMiddleware, CancelUpdate, SkipHandler, State, ContinueHandling
from inspect import signature
from inspect import signature, iscoroutinefunction
from telebot import util, types, asyncio_helper
import asyncio
@ -536,6 +536,7 @@ class AsyncTeleBot:
if not isinstance(result, ContinueHandling):
break
except Exception as e:
handler_error = e
if self.exception_handler:
self.exception_handler.handle(e)
else:
@ -836,6 +837,8 @@ class AsyncTeleBot:
elif message_filter == 'chat_types':
return message.chat.type in filter_value
elif message_filter == 'func':
if iscoroutinefunction(filter_value):
return await filter_value(message)
return filter_value(message)
elif self.custom_filters and message_filter in self.custom_filters:
return await self._check_filter(message_filter,filter_value,message)
@ -4361,6 +4364,40 @@ class AsyncTeleBot:
result = await asyncio_helper.get_my_commands(self.token, scope, language_code)
return [types.BotCommand.de_json(cmd) for cmd in result]
async def set_my_name(self, name: Optional[str]=None, language_code: Optional[str]=None):
"""
Use this method to change the bot's name. Returns True on success.
Telegram documentation: https://core.telegram.org/bots/api#setmyname
:param name: Optional. New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
:type name: :obj:`str`
:param language_code: Optional. A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose
language there is no dedicated name.
:type language_code: :obj:`str`
:return: True on success.
"""
return await asyncio_helper.set_my_name(self.token, name, language_code)
async def get_my_name(self, language_code: Optional[str]=None):
"""
Use this method to get the current bot name for the given user language.
Returns BotName on success.
Telegram documentation: https://core.telegram.org/bots/api#getmyname
:param language_code: Optional. A two-letter ISO 639-1 language code or an empty string
:type language_code: :obj:`str`
:return: :class:`telebot.types.BotName`
"""
result = await asyncio_helper.get_my_name(self.token, language_code)
return types.BotName.de_json(result)
async def set_chat_menu_button(self, chat_id: Union[int, str]=None,
menu_button: types.MenuButton=None) -> bool:
"""
@ -5337,7 +5374,8 @@ class AsyncTeleBot:
is_personal: Optional[bool]=None,
next_offset: Optional[str]=None,
switch_pm_text: Optional[str]=None,
switch_pm_parameter: Optional[str]=None) -> bool:
switch_pm_parameter: Optional[str]=None,
button: Optional[types.InlineQueryResultsButton]=None) -> bool:
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
@ -5373,11 +5411,18 @@ class AsyncTeleBot:
:param switch_pm_text: Parameter for the start message sent to the bot when user presses the switch button
:type switch_pm_text: :obj:`str`
:param button: A JSON-serialized object describing a button to be shown above inline query results
:type button: :obj:`types.InlineQueryResultsButton`
:return: On success, True is returned.
:rtype: :obj:`bool`
"""
if not button and (switch_pm_text or switch_pm_parameter):
logger.warning("switch_pm_text and switch_pm_parameter are deprecated for answer_inline_query. Use button instead.")
button = types.InlineQueryResultsButton(text=switch_pm_text, start_parameter=switch_pm_parameter)
return await asyncio_helper.answer_inline_query(self.token, inline_query_id, results, cache_time, is_personal, next_offset,
switch_pm_text, switch_pm_parameter)
button)
async def answer_callback_query(
self, callback_query_id: int,

View File

@ -1183,6 +1183,23 @@ async def get_my_commands(token, scope=None, language_code=None):
payload['language_code'] = language_code
return await _process_request(token, method_url, params=payload)
async def set_my_name(token, name=None, language_code=None):
method_url = r'setMyName'
payload = {}
if name is not None:
payload['name'] = name
if language_code is not None:
payload['language_code'] = language_code
return await _process_request(token, method_url, params=payload, method='post')
async def get_my_name(token, language_code=None):
method_url = r'getMyName'
payload = {}
if language_code is not None:
payload['language_code'] = language_code
return await _process_request(token, method_url, params=payload)
async def set_chat_menu_button(token, chat_id=None, menu_button=None):
method_url = r'setChatMenuButton'
payload = {}
@ -1587,7 +1604,7 @@ async def answer_callback_query(token, callback_query_id, text=None, show_alert=
async def answer_inline_query(token, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
button=None):
method_url = 'answerInlineQuery'
payload = {'inline_query_id': inline_query_id, 'results': await _convert_list_json_serializable(results)}
if cache_time is not None:
@ -1596,10 +1613,10 @@ async def answer_inline_query(token, inline_query_id, results, cache_time=None,
payload['is_personal'] = is_personal
if next_offset is not None:
payload['next_offset'] = next_offset
if switch_pm_text:
payload['switch_pm_text'] = switch_pm_text
if switch_pm_parameter:
payload['switch_pm_parameter'] = switch_pm_parameter
if button is not None:
payload["button"] = button.to_json()
return await _process_request(token, method_url, params=payload, method='post')

View File

@ -1,10 +1,11 @@
from telebot.asyncio_storage.base_storage import StateStorageBase, StateContext
import json
redis_installed = True
is_actual_aioredis = False
try:
import aioredis
is_actual_aioredis = True
except ImportError:
try:
from redis import asyncio as aioredis
@ -23,10 +24,10 @@ class StateRedisStorage(StateStorageBase):
if not redis_installed:
raise ImportError('AioRedis is not installed. Install it via "pip install aioredis"')
aioredis_version = tuple(map(int, aioredis.__version__.split(".")[0]))
if aioredis_version < (2,):
raise ImportError('Invalid aioredis version. Aioredis version should be >= 2.0.0')
if is_actual_aioredis:
aioredis_version = tuple(map(int, aioredis.__version__.split(".")[0]))
if aioredis_version < (2,):
raise ImportError('Invalid aioredis version. Aioredis version should be >= 2.0.0')
self.redis = aioredis.Redis(host=host, port=port, db=db, password=password)
self.prefix = prefix

View File

@ -61,8 +61,8 @@ def escape_markdown(content: str) -> str:
:rtype: :obj:`str`
"""
parse = re.sub(r"([_*\[\]()~`>\#\+\-=|\.!\{\}])", r"\\\1", content)
reparse = re.sub(r"\\\\([_*\[\]()~`>\#\+\-=|\.!\{\}])", r"\1", parse)
parse = re.sub(r"([_*\[\]()~`>\#\+\-=|\.!\{\}\\])", r"\\\1", content)
reparse = re.sub(r"\\\\([_*\[\]()~`>\#\+\-=|\.!\{\}\\])", r"\1", parse)
return reparse

View File

@ -237,6 +237,9 @@ class ChatMemberUpdated(JsonDeserializable):
link events only.
:type invite_link: :class:`telebot.types.ChatInviteLink`
:param via_chat_folder_invite_link: Optional. True, if the user joined the chat via a chat folder invite link
:type via_chat_folder_invite_link: :obj:`bool`
:return: Instance of the class
:rtype: :class:`telebot.types.ChatMemberUpdated`
"""
@ -251,13 +254,15 @@ class ChatMemberUpdated(JsonDeserializable):
obj['invite_link'] = ChatInviteLink.de_json(obj.get('invite_link'))
return cls(**obj)
def __init__(self, chat, from_user, date, old_chat_member, new_chat_member, invite_link=None, **kwargs):
def __init__(self, chat, from_user, date, old_chat_member, new_chat_member, invite_link=None, via_chat_folder_invite_link=None,
**kwargs):
self.chat: Chat = chat
self.from_user: User = from_user
self.date: int = date
self.old_chat_member: ChatMember = old_chat_member
self.new_chat_member: ChatMember = new_chat_member
self.invite_link: Optional[ChatInviteLink] = invite_link
self.via_chat_folder_invite_link: Optional[bool] = via_chat_folder_invite_link
@property
def difference(self) -> Dict[str, List]:
@ -1308,6 +1313,7 @@ class Message(JsonDeserializable):
"strikethrough": "<s>{text}</s>",
"underline": "<u>{text}</u>",
"spoiler": "<span class=\"tg-spoiler\">{text}</span>",
"custom_emoji": "<tg-emoji emoji-id=\"{custom_emoji_id}\">{text}</tg-emoji>"
}
if hasattr(self, "custom_subs"):
@ -1316,7 +1322,7 @@ class Message(JsonDeserializable):
utf16_text = text.encode("utf-16-le")
html_text = ""
def func(upd_text, subst_type=None, url=None, user=None):
def func(upd_text, subst_type=None, url=None, user=None, custom_emoji_id=None):
upd_text = upd_text.decode("utf-16-le")
if subst_type == "text_mention":
subst_type = "text_link"
@ -1327,30 +1333,41 @@ class Message(JsonDeserializable):
if not subst_type or not _subs.get(subst_type):
return upd_text
subs = _subs.get(subst_type)
if subst_type == "custom_emoji":
return subs.format(text=upd_text, custom_emoji_id=custom_emoji_id)
return subs.format(text=upd_text, url=url)
offset = 0
start_index = 0
end_index = 0
for entity in entities:
if entity.offset > offset:
# when the offset is not 0: for example, a __b__
# we need to add the text before the entity to the html_text
html_text += func(utf16_text[offset * 2 : entity.offset * 2])
offset = entity.offset
html_text += func(utf16_text[offset * 2 : (offset + entity.length) * 2], entity.type, entity.url, entity.user)
new_string = func(utf16_text[offset * 2 : (offset + entity.length) * 2], entity.type, entity.url, entity.user, entity.custom_emoji_id)
start_index = len(html_text)
html_text += new_string
offset += entity.length
end_index = len(html_text)
elif entity.offset == offset:
html_text += func(utf16_text[offset * 2 : (offset + entity.length) * 2], entity.type, entity.url, entity.user)
new_string = func(utf16_text[offset * 2 : (offset + entity.length) * 2], entity.type, entity.url, entity.user, entity.custom_emoji_id)
start_index = len(html_text)
html_text += new_string
end_index = len(html_text)
offset += entity.length
else:
# Here we are processing nested entities.
# We shouldn't update offset, because they are the same as entity before.
# And, here we are replacing previous string with a new html-rendered text(previous string is already html-rendered,
# And we don't change it).
entity_string = utf16_text[entity.offset * 2 : (entity.offset + entity.length) * 2]
formatted_string = func(entity_string, entity.type, entity.url, entity.user)
entity_string_decoded = entity_string.decode("utf-16-le")
last_occurence = html_text.rfind(entity_string_decoded)
string_length = len(entity_string_decoded)
#html_text = html_text.replace(html_text[last_occurence:last_occurence+string_length], formatted_string)
html_text = html_text[:last_occurence] + formatted_string + html_text[last_occurence+string_length:]
entity_string = html_text[start_index : end_index].encode("utf-16-le")
formatted_string = func(entity_string, entity.type, entity.url, entity.user, entity.custom_emoji_id).replace("&amp;", "&").replace("&lt;", "<").replace("&gt;",">")
html_text = html_text[:start_index] + formatted_string + html_text[end_index:]
end_index = len(html_text)
if offset * 2 < len(utf16_text):
html_text += func(utf16_text[offset * 2:])
@ -2592,6 +2609,10 @@ class InlineKeyboardButton(Dictionaryable, JsonSerializable, JsonDeserializable)
something from multiple options.
:type switch_inline_query_current_chat: :obj:`str`
:param switch_inline_query_chosen_chat: Optional. If set, pressing the button will prompt the user to select one of their chats of the
specified type, open that chat and insert the bot's username and the specified inline query in the input field
:type switch_inline_query_chosen_chat: :class:`telebot.types.SwitchInlineQueryChosenChat`
:param callback_game: Optional. Description of the game that will be launched when the user presses the
button. NOTE: This type of button must always be the first button in the first row.
:type callback_game: :class:`telebot.types.CallbackGame`
@ -2611,17 +2632,20 @@ class InlineKeyboardButton(Dictionaryable, JsonSerializable, JsonDeserializable)
obj['login_url'] = LoginUrl.de_json(obj.get('login_url'))
if 'web_app' in obj:
obj['web_app'] = WebAppInfo.de_json(obj.get('web_app'))
if 'switch_inline_query_chosen_chat' in obj:
obj['switch_inline_query_chosen_chat'] = SwitchInlineQueryChosenChat.de_json(obj.get('switch_inline_query_chosen_chat'))
return cls(**obj)
def __init__(self, text, url=None, callback_data=None, web_app=None, switch_inline_query=None,
switch_inline_query_current_chat=None, callback_game=None, pay=None, login_url=None, **kwargs):
switch_inline_query_current_chat=None, switch_inline_query_chosen_chat=None, callback_game=None, pay=None, login_url=None, **kwargs):
self.text: str = text
self.url: str = url
self.callback_data: str = callback_data
self.web_app: WebAppInfo = web_app
self.switch_inline_query: str = switch_inline_query
self.switch_inline_query_current_chat: str = switch_inline_query_current_chat
self.switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat = switch_inline_query_chosen_chat
self.callback_game = callback_game # Not Implemented
self.pay: bool = pay
self.login_url: LoginUrl = login_url
@ -2647,6 +2671,8 @@ class InlineKeyboardButton(Dictionaryable, JsonSerializable, JsonDeserializable)
json_dict['pay'] = self.pay
if self.login_url is not None:
json_dict['login_url'] = self.login_url.to_dict()
if self.switch_inline_query_chosen_chat is not None:
json_dict['switch_inline_query_chosen_chat'] = self.switch_inline_query_chosen_chat.to_dict()
return json_dict
@ -7224,7 +7250,7 @@ class InputFile:
_file = open(file, 'rb')
return _file, os.path.basename(_file.name)
elif isinstance(file, IOBase):
return file, os.path.basename(file.name)
return file, service_utils.generate_random_token()
elif isinstance(file, Path):
_file = open(file, 'rb')
return _file, os.path.basename(_file.name)
@ -7396,13 +7422,20 @@ class WriteAccessAllowed(JsonDeserializable):
Currently holds no information.
Telegram documentation: https://core.telegram.org/bots/api#writeaccessallowed
:param web_app_name: Optional. Name of the Web App which was launched from a link
:type web_app_name: :obj:`str`
"""
@classmethod
def de_json(cls, json_string):
return cls()
if json_string is None: return None
obj = cls.check_json(json_string)
return cls(**obj)
def __init__(self) -> None:
pass
def __init__(self, web_app_name: str) -> None:
self.web_app_name: str = web_app_name
class UserShared(JsonDeserializable):
@ -7576,4 +7609,137 @@ class InputSticker(Dictionaryable, JsonSerializable):
return self.to_json(), {self._sticker_name: self.sticker}
class SwitchInlineQueryChosenChat(JsonDeserializable, Dictionaryable, JsonSerializable):
"""
Represents an inline button that switches the current user to inline mode in a chosen chat,
with an optional default inline query.
Telegram Documentation: https://core.telegram.org/bots/api#inlinekeyboardbutton
:param query: Optional. The default inline query to be inserted in the input field.
If left empty, only the bot's username will be inserted
:type query: :obj:`str`
:param allow_user_chats: Optional. True, if private chats with users can be chosen
:type allow_user_chats: :obj:`bool`
:param allow_bot_chats: Optional. True, if private chats with bots can be chosen
:type allow_bot_chats: :obj:`bool`
:param allow_group_chats: Optional. True, if group and supergroup chats can be chosen
:type allow_group_chats: :obj:`bool`
:param allow_channel_chats: Optional. True, if channel chats can be chosen
:type allow_channel_chats: :obj:`bool`
:return: Instance of the class
:rtype: :class:`SwitchInlineQueryChosenChat`
"""
@classmethod
def de_json(cls, json_string):
if json_string is None:
return None
obj = cls.check_json(json_string)
return cls(**obj)
def __init__(self, query=None, allow_user_chats=None, allow_bot_chats=None, allow_group_chats=None,
allow_channel_chats=None):
self.query: str = query
self.allow_user_chats: bool = allow_user_chats
self.allow_bot_chats: bool = allow_bot_chats
self.allow_group_chats: bool = allow_group_chats
self.allow_channel_chats: bool = allow_channel_chats
def to_dict(self):
json_dict = {}
if self.query is not None:
json_dict['query'] = self.query
if self.allow_user_chats is not None:
json_dict['allow_user_chats'] = self.allow_user_chats
if self.allow_bot_chats is not None:
json_dict['allow_bot_chats'] = self.allow_bot_chats
if self.allow_group_chats is not None:
json_dict['allow_group_chats'] = self.allow_group_chats
if self.allow_channel_chats is not None:
json_dict['allow_channel_chats'] = self.allow_channel_chats
return json_dict
def to_json(self):
return json.dumps(self.to_dict())
class BotName(JsonDeserializable):
"""
This object represents a bot name.
Telegram Documentation: https://core.telegram.org/bots/api#botname
:param name: The bot name
:type name: :obj:`str`
:return: Instance of the class
:rtype: :class:`BotName`
"""
@classmethod
def de_json(cls, json_string):
if json_string is None:
return None
obj = cls.check_json(json_string)
return cls(**obj)
def __init__(self, name: str):
self.name: str = name
class InlineQueryResultsButton(JsonSerializable, Dictionaryable):
"""
This object represents a button to be shown above inline query results.
You must use exactly one of the optional fields.
Telegram documentation: https://core.telegram.org/bots/api#inlinequeryresultsbutton
:param text: Label text on the button
:type text: :obj:`str`
:param web_app: Optional. Description of the Web App that will be launched when the user presses the button.
The Web App will be able to switch back to the inline mode using the method web_app_switch_inline_query inside the Web App.
:type web_app: :class:`telebot.types.WebAppInfo`
:param start_parameter: Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the button.
1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search
results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing
any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs
the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat
where they wanted to use the bot's inline capabilities.
:type start_parameter: :obj:`str`
:return: Instance of the class
:rtype: :class:`InlineQueryResultsButton`
"""
def __init__(self, text: str, web_app: Optional[WebAppInfo]=None, start_parameter: Optional[str]=None) -> None:
self.text: str = text
self.web_app: Optional[WebAppInfo] = web_app
self.start_parameter: Optional[str] = start_parameter
def to_dict(self) -> dict:
json_dict = {
'text': self.text
}
if self.web_app is not None:
json_dict['web_app'] = self.web_app.to_dict()
if self.start_parameter is not None:
json_dict['start_parameter'] = self.start_parameter
return json_dict
def to_json(self) -> str:
return json.dumps(self.to_dict())

View File

@ -590,7 +590,7 @@ def webhook_google_functions(bot, request):
return 'Bot ON'
def antiflood(function: Callable, *args, **kwargs):
def antiflood(function: Callable, *args, number_retries=5, **kwargs):
"""
Use this function inside loops in order to avoid getting TooManyRequests error.
Example:
@ -604,6 +604,9 @@ def antiflood(function: Callable, *args, **kwargs):
:param function: The function to call
:type function: :obj:`Callable`
:param number_retries: Number of retries to send
:type function: :obj:int
:param args: The arguments to pass to the function
:type args: :obj:`tuple`
@ -615,14 +618,16 @@ def antiflood(function: Callable, *args, **kwargs):
from telebot.apihelper import ApiTelegramException
from time import sleep
try:
return function(*args, **kwargs)
except ApiTelegramException as ex:
if ex.error_code == 429:
sleep(ex.result_json['parameters']['retry_after'])
for _ in range(number_retries - 1):
try:
return function(*args, **kwargs)
else:
raise
except ApiTelegramException as ex:
if ex.error_code == 429:
sleep(ex.result_json['parameters']['retry_after'])
else:
raise
else:
return function(*args, **kwargs)
def parse_web_app_data(token: str, raw_init_data: str):

View File

@ -1,3 +1,3 @@
# Versions should comply with PEP440.
# This line is parsed in setup.py:
__version__ = '4.11.0'
__version__ = '4.12.0'

View File

@ -271,5 +271,33 @@ def test_sent_web_app_message():
assert sent_web_app_message.inline_message_id == '29430'
def test_message_entity():
# TODO: Add support for nesting entities
sample_string_1 = r'{"update_id":934522126,"message":{"message_id":1374510,"from":{"id":927266710,"is_bot":false,"first_name":">_run","username":"coder2020","language_code":"en","is_premium":true},"chat":{"id":927266710,"first_name":">_run","username":"coder2020","type":"private"},"date":1682177590,"text":"b b b","entities":[{"offset":0,"length":2,"type":"bold"},{"offset":0,"length":1,"type":"italic"},{"offset":2,"length":2,"type":"bold"},{"offset":2,"length":1,"type":"italic"},{"offset":4,"length":1,"type":"bold"},{"offset":4,"length":1,"type":"italic"}]}}'
update = types.Update.de_json(sample_string_1)
message: types.Message = update.message
assert message.html_text == "<i><b>b </b></i><i><b>b </b></i><i><b>b</b></i>"
sample_string_2 = r'{"update_id":934522166,"message":{"message_id":1374526,"from":{"id":927266710,"is_bot":false,"first_name":">_run","username":"coder2020","language_code":"en","is_premium":true},"chat":{"id":927266710,"first_name":">_run","username":"coder2020","type":"private"},"date":1682179716,"text":"b b b","entities":[{"offset":0,"length":1,"type":"bold"},{"offset":2,"length":1,"type":"bold"},{"offset":4,"length":1,"type":"italic"}]}}'
message_2 = types.Update.de_json(sample_string_2).message
assert message_2.html_text == "<b>b</b> <b>b</b> <i>b</i>"
sample_string_3 = r'{"update_id":934522172,"message":{"message_id":1374530,"from":{"id":927266710,"is_bot":false,"first_name":">_run","username":"coder2020","language_code":"en","is_premium":true},"chat":{"id":927266710,"first_name":">_run","username":"coder2020","type":"private"},"date":1682179968,"text":"This is a bold text with a nested italic and bold text.","entities":[{"offset":10,"length":4,"type":"bold"},{"offset":27,"length":7,"type":"italic"},{"offset":34,"length":15,"type":"bold"},{"offset":34,"length":15,"type":"italic"}]}}'
message_3 = types.Update.de_json(sample_string_3).message
assert message_3.html_text == "This is a <b>bold</b> text with a <i>nested </i><i><b>italic and bold</b></i> text."
sample_string_4 = r'{"update_id":934522437,"message":{"message_id":1374619,"from":{"id":927266710,"is_bot":false,"first_name":">_run","username":"coder2020","language_code":"en","is_premium":true},"chat":{"id":927266710,"first_name":">_run","username":"coder2020","type":"private"},"date":1682189507,"forward_from":{"id":927266710,"is_bot":false,"first_name":">_run","username":"coder2020","language_code":"en","is_premium":true},"forward_date":1682189124,"text":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa😋😋","entities":[{"offset":0,"length":76,"type":"bold"},{"offset":0,"length":76,"type":"italic"},{"offset":0,"length":76,"type":"underline"},{"offset":0,"length":76,"type":"strikethrough"},{"offset":76,"length":2,"type":"custom_emoji","custom_emoji_id":"5456188142006575553"},{"offset":78,"length":2,"type":"custom_emoji","custom_emoji_id":"5456188142006575553"}]}}'
message_4 = types.Update.de_json(sample_string_4).message
assert message_4.html_text == '<s><u><i><b>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</b></i></u></s><tg-emoji emoji-id="5456188142006575553">😋</tg-emoji><tg-emoji emoji-id="5456188142006575553">😋</tg-emoji>'