From 4071ab91244d793d4e8b5dd8c6ccbfc9fd92fd51 Mon Sep 17 00:00:00 2001 From: _run Date: Sun, 12 Sep 2021 20:41:26 +0500 Subject: [PATCH] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 1adc743..a40e5ff 100644 --- a/README.md +++ b/README.md @@ -306,7 +306,7 @@ If you want to add some built-in filter, you are welcome to add it in custom_fil Here is example of creating filter-class: -``` +```python class IsAdmin(util.SimpleCustomFilter): # Class will check whether the user is admin or creator in group or not key='is_admin' @@ -314,14 +314,10 @@ 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()) - # Now, you can use it in handler. - @bot.message_handler(is_admin=True) ```