mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
pyrofork: subscription_until_date field to class ChatMember
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
a138170e1e
commit
889c32ca2b
2 changed files with 9 additions and 2 deletions
|
|
@ -204,7 +204,7 @@ class Chat(Object):
|
||||||
The maximum number of reactions that can be set on a message in the chat
|
The maximum number of reactions that can be set on a message in the chat
|
||||||
|
|
||||||
subscription_until_date (:py:obj:`~datetime.datetime`, *optional*):
|
subscription_until_date (:py:obj:`~datetime.datetime`, *optional*):
|
||||||
Date when the subscription expires.
|
Channel members only. Date when the subscription expires.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,9 @@ class ChatMember(Object):
|
||||||
|
|
||||||
privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
|
privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
|
||||||
Administrators only. Privileged actions that an administrator is able to take.
|
Administrators only. Privileged actions that an administrator is able to take.
|
||||||
|
|
||||||
|
subscription_until_date (:py:obj:`~datetime.datetime`, *optional*):
|
||||||
|
Channel members only. Date when the subscription will expire.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
@ -89,7 +92,8 @@ class ChatMember(Object):
|
||||||
is_member: bool = None,
|
is_member: bool = None,
|
||||||
can_be_edited: bool = None,
|
can_be_edited: bool = None,
|
||||||
permissions: "types.ChatPermissions" = None,
|
permissions: "types.ChatPermissions" = None,
|
||||||
privileges: "types.ChatPrivileges" = None
|
privileges: "types.ChatPrivileges" = None,
|
||||||
|
subscription_until_date: datetime = None
|
||||||
):
|
):
|
||||||
super().__init__(client)
|
super().__init__(client)
|
||||||
|
|
||||||
|
|
@ -106,6 +110,7 @@ class ChatMember(Object):
|
||||||
self.can_be_edited = can_be_edited
|
self.can_be_edited = can_be_edited
|
||||||
self.permissions = permissions
|
self.permissions = permissions
|
||||||
self.privileges = privileges
|
self.privileges = privileges
|
||||||
|
self.subscription_until_date = subscription_until_date
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(
|
def _parse(
|
||||||
|
|
@ -144,6 +149,7 @@ class ChatMember(Object):
|
||||||
status=enums.ChatMemberStatus.MEMBER,
|
status=enums.ChatMemberStatus.MEMBER,
|
||||||
user=types.User._parse(client, users[member.user_id]),
|
user=types.User._parse(client, users[member.user_id]),
|
||||||
joined_date=utils.timestamp_to_datetime(member.date),
|
joined_date=utils.timestamp_to_datetime(member.date),
|
||||||
|
subscription_until_date=utils.timestamp_to_datetime(member.subscription_until_date),
|
||||||
client=client
|
client=client
|
||||||
)
|
)
|
||||||
elif isinstance(member, raw.types.ChannelParticipantAdmin):
|
elif isinstance(member, raw.types.ChannelParticipantAdmin):
|
||||||
|
|
@ -224,5 +230,6 @@ class ChatMember(Object):
|
||||||
user=types.User._parse(client, users[member.user_id]),
|
user=types.User._parse(client, users[member.user_id]),
|
||||||
joined_date=utils.timestamp_to_datetime(member.date),
|
joined_date=utils.timestamp_to_datetime(member.date),
|
||||||
invited_by=types.User._parse(client, users[member.inviter_id]),
|
invited_by=types.User._parse(client, users[member.inviter_id]),
|
||||||
|
subscription_until_date=utils.timestamp_to_datetime(member.subscription_until_date),
|
||||||
client=client
|
client=client
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue