Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesome-RJ authored Sep 7, 2022
1 parent 4f59bc7 commit 2b8709b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Cutiepii_Robot/modules/helper_funcs/admin_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ def user_is_admin(
if not member:
try:
return user_id in ADMIN_CACHE[chat.id]
except KeyError:
chat_admins = await CUTIEPII_PTB.bot.getChatAdministrators(chat.id)
admin_list = [x.user.id for x in chat_admins]
ADMIN_CACHE[chat.id] = admin_list

if user_id in admin_list:
return True
return False
except KeyError:
chat_admins = await CUTIEPII_PTB.bot.getChatAdministrators(chat.id)
admin_list = [x.user.id for x in chat_admins]
ADMIN_CACHE[chat.id] = admin_list
if user_id in admin_list:
return True
return False


RLOCK = RLock()
Expand Down

0 comments on commit 2b8709b

Please sign in to comment.