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'
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user