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-09-12 20:43:09 +05:00 committed by GitHub
parent 4071ab9124
commit c86af0496b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,11 +314,13 @@ class IsAdmin(util.SimpleCustomFilter):
def check(message: telebot.types.Message):
return bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']
# To register filter, you need to use method add_custom_filter.
bot.add_custom_filter(IsAdmin())
# To register filter, you need to use method add_custom_filter.
bot.add_custom_filter(IsAdmin())
# Now, you can use it in handler.
@bot.message_handler(is_admin=True)
# Now, you can use it in handler.
@bot.message_handler(is_admin=True)
def admin_of_group(message):
bot.send_message(message.chat.id, 'You are admin of this group'!)
```