1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update custom_filters.py

This commit is contained in:
coder2020official 2021-09-12 19:38:54 +05:00
parent 5f8c75816e
commit 1ceec3cb54

View File

@ -16,10 +16,7 @@ class IsAdmin(util.SimpleCustomFilter):
key='is_admin' key='is_admin'
@staticmethod @staticmethod
def check(message: telebot.types.Message): def check(message: telebot.types.Message):
if bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']: return bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']
return True
else:
return False
@bot.message_handler(is_admin=True, commands=['admin']) # Check if user is admin @bot.message_handler(is_admin=True, commands=['admin']) # Check if user is admin