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 5d7e0b0 commit 6d2c360
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cutiepii_Robot/modules/helper_funcs/chat_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
def can_delete(chat: Chat, bot_id: int) -> bool:
return chat.get_member(bot_id).can_delete_messages

def is_bot_admin(chat: Chat, bot_id: int, bot_member: ChatMember = None) -> bool:
if chat.type == "private" or chat.all_members_are_administrators:
return True

if not bot_member:
bot_member = chat.get_member(bot_id)

return bot_member.status in ("administrator", "creator")

def is_anon(user: User, chat: Chat):
return chat.get_member(user.id).is_anonymous
Expand Down

0 comments on commit 6d2c360

Please sign in to comment.