Update creator ChatMember with admin permissions (#523)
This commit is contained in:
parent
61df1957a0
commit
740bcd145a
@ -217,6 +217,26 @@ class ChatMember(Object):
|
|||||||
status="creator",
|
status="creator",
|
||||||
client=client
|
client=client
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if isinstance(member, raw.types.ChannelParticipantCreator):
|
||||||
|
permissions = member.admin_rights
|
||||||
|
return ChatMember(
|
||||||
|
user=user,
|
||||||
|
status="creator",
|
||||||
|
title=getattr(member, "rank", None),
|
||||||
|
joined_date=member.date,
|
||||||
|
invited_by=invited_by,
|
||||||
|
can_be_edited=member.can_edit,
|
||||||
|
can_change_info=permissions.change_info,
|
||||||
|
can_post_messages=permissions.post_messages,
|
||||||
|
can_edit_messages=permissions.edit_messages,
|
||||||
|
can_delete_messages=permissions.delete_messages,
|
||||||
|
can_restrict_members=permissions.ban_users,
|
||||||
|
can_invite_users=permissions.invite_users,
|
||||||
|
can_pin_messages=permissions.pin_messages,
|
||||||
|
can_promote_members=permissions.add_admins,
|
||||||
|
client=client
|
||||||
|
)
|
||||||
|
|
||||||
if isinstance(member, raw.types.ChatParticipantAdmin):
|
if isinstance(member, raw.types.ChatParticipantAdmin):
|
||||||
return ChatMember(
|
return ChatMember(
|
||||||
|
Loading…
Reference in New Issue
Block a user