1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update README.md

This commit is contained in:
_run 2021-12-04 21:57:16 +05:00
parent fb52137bff
commit a5ee5f816c

View File

@ -6,10 +6,10 @@
# <p align="center">pyTelegramBotAPI # <p align="center">pyTelegramBotAPI
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>. <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">Supports both sync and async ways.</a> <p align="center">Supports both sync and async ways.</p>
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#november-5-2021">5.4</a>! ## <p align="center">Supporting Bot API version: <a href="https://core.telegram.org/bots/api#november-5-2021">5.4</a>!
## Contents ## Contents
@ -53,7 +53,7 @@
* [Proxy](#proxy) * [Proxy](#proxy)
* [Testing](#testing) * [Testing](#testing)
* [API conformance](#api-conformance) * [API conformance](#api-conformance)
* [Asynchronous TeleBot](#asynctelebot) * [AsyncTeleBot](#asynctelebot)
* [F.A.Q.](#faq) * [F.A.Q.](#faq)
* [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat) * [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat)
* [How can I handle reocurring ConnectionResetErrors?](#how-can-i-handle-reocurring-connectionreseterrors) * [How can I handle reocurring ConnectionResetErrors?](#how-can-i-handle-reocurring-connectionreseterrors)
@ -184,8 +184,8 @@ TeleBot supports the following filters:
|content_types|list of strings (default `['text']`)|`True` if message.content_type is in the list of strings.| |content_types|list of strings (default `['text']`)|`True` if message.content_type is in the list of strings.|
|regexp|a regular expression as a string|`True` if `re.search(regexp_arg)` returns `True` and `message.content_type == 'text'` (See [Python Regular Expressions](https://docs.python.org/2/library/re.html))| |regexp|a regular expression as a string|`True` if `re.search(regexp_arg)` returns `True` and `message.content_type == 'text'` (See [Python Regular Expressions](https://docs.python.org/2/library/re.html))|
|commands|list of strings|`True` if `message.content_type == 'text'` and `message.text` starts with a command that is in the list of strings.| |commands|list of strings|`True` if `message.content_type == 'text'` and `message.text` starts with a command that is in the list of strings.|
|chat_types|list of chat types|`True` if `message.chat.type` in your filter |chat_types|list of chat types|`True` if `message.chat.type` in your filter|
|func|a function (lambda or function reference)|`True` if the lambda or function reference returns `True` |func|a function (lambda or function reference)|`True` if the lambda or function reference returns `True`|
Here are some examples of using the filters and message handlers: Here are some examples of using the filters and message handlers:
@ -376,7 +376,7 @@ bot.add_custom_filter(IsAdmin())
# Now, you can use it in handler. # Now, you can use it in handler.
@bot.message_handler(is_admin=True) @bot.message_handler(is_admin=True)
def admin_of_group(message): def admin_of_group(message):
bot.send_message(message.chat.id, 'You are admin of this group'!) bot.send_message(message.chat.id, 'You are admin of this group!')
``` ```
@ -572,7 +572,7 @@ tb = telebot.AsyncTeleBot("TOKEN")
@tb.message_handler(commands=['start']) @tb.message_handler(commands=['start'])
async def start_message(message): async def start_message(message):
await bot.send_message(message.chat.id, 'Hello'!) await bot.send_message(message.chat.id, 'Hello!')
``` ```