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:
parent
4071ab9124
commit
c86af0496b
10
README.md
10
README.md
@ -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'!)
|
||||
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user