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:
parent
5f8c75816e
commit
1ceec3cb54
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user