Skip to content

Commit

Permalink
pyrofork: types: EmojiStatus: Sync with layer 198
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <[email protected]>
  • Loading branch information
wulan17 committed Jan 26, 2025
1 parent 5c696a9 commit 9735251
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions pyrogram/types/user_and_chats/emoji_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,16 @@ def __init__(
@staticmethod
def _parse(client, emoji_status: "raw.base.EmojiStatus") -> Optional["EmojiStatus"]:
if isinstance(emoji_status, raw.types.EmojiStatus):
return EmojiStatus(
client=client,
custom_emoji_id=emoji_status.document_id
)

if isinstance(emoji_status, raw.types.EmojiStatusUntil):
return EmojiStatus(
client=client,
custom_emoji_id=emoji_status.document_id,
until_date=utils.timestamp_to_datetime(emoji_status.until)
until_date=utils.timestamp_to_datetime(emoji_status.until) if emoji_status.until else None
)

return None

def write(self):
if self.until_date:
return raw.types.EmojiStatusUntil(
document_id=self.custom_emoji_id,
until=utils.datetime_to_timestamp(self.until_date)
)

return raw.types.EmojiStatus(
document_id=self.custom_emoji_id
document_id=self.custom_emoji_id,
until=utils.datetime_to_timestamp(self.until_date)
)

0 comments on commit 9735251

Please sign in to comment.