mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: types: EmojiStatus: Sync with layer 198
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
377fda434b
commit
3180267107
1 changed files with 3 additions and 14 deletions
|
|
@ -52,27 +52,16 @@ class EmojiStatus(Object):
|
|||
@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) if self.until_date else None
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue