From 1ceec3cb54593a5613c804e64d08116d45723e1b Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sun, 12 Sep 2021 19:38:54 +0500 Subject: [PATCH] Update custom_filters.py --- examples/custom_filters.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/custom_filters.py b/examples/custom_filters.py index e9e40e8..18c8c26 100644 --- a/examples/custom_filters.py +++ b/examples/custom_filters.py @@ -16,10 +16,7 @@ class IsAdmin(util.SimpleCustomFilter): key='is_admin' @staticmethod def check(message: telebot.types.Message): - if bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']: - return True - else: - return False + return bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator'] @bot.message_handler(is_admin=True, commands=['admin']) # Check if user is admin