Update custom_filters.py

This commit is contained in:
coder2020official 2021-09-12 19:38:54 +05:00
parent 5f8c75816e
commit 1ceec3cb54
1 changed files with 1 additions and 4 deletions

View File

@ -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