@@ -33,44 +33,97 @@ class EmojiStatus(Object):
3333 """A user emoji status.
3434
3535 Parameters:
36- custom_emoji_id (``int``):
36+ custom_emoji_id (``int``, *optional* ):
3737 Custom emoji id.
3838
3939 until_date (:py:obj:`~datetime.datetime`, *optional*):
4040 Valid until date.
41+
42+ title (``str``, *optional*):
43+ Title of the collectible.
44+
45+ gift_id (``int``, *optional*):
46+ Gift collectible id.
47+
48+ name (``str``, *optional*):
49+ Name of the collectible.
50+
51+ pattern_custom_emoji_id (``int``, *optional*):
52+ Pattern emoji id.
53+
54+ center_color (``int``, *optional*):
55+ Center color of the collectible emoji in decimal format.
56+
57+ edge_color (``int``, *optional*):
58+ Edge color of the collectible emoji in decimal format.
59+
60+ pattern_color (``int``, *optional*):
61+ Pattern color of the collectible emoji in decimal format.
62+
63+ text_color (``int``, *optional*):
64+ Text color of the collectible emoji in decimal format.
4165 """
4266
4367 def __init__ (
4468 self ,
4569 * ,
4670 client : hydrogram .Client = None ,
47- custom_emoji_id : int ,
71+ custom_emoji_id : int | None = None ,
72+ gift_id : int | None = None ,
4873 until_date : datetime | None = None ,
74+ title : str | None = None ,
75+ name : str | None = None ,
76+ pattern_custom_emoji_id : int | None = None ,
77+ center_color : int | None = None ,
78+ edge_color : int | None = None ,
79+ pattern_color : int | None = None ,
80+ text_color : int | None = None ,
4981 ):
5082 super ().__init__ (client )
5183
5284 self .custom_emoji_id = custom_emoji_id
85+ self .gift_id = gift_id
5386 self .until_date = until_date
87+ self .title = title
88+ self .name = name
89+ self .pattern_custom_emoji_id = pattern_custom_emoji_id
90+ self .center_color = center_color
91+ self .edge_color = edge_color
92+ self .pattern_color = pattern_color
93+ self .text_color = text_color
5494
5595 @staticmethod
5696 def _parse (client , emoji_status : raw .base .EmojiStatus ) -> EmojiStatus | None :
5797 if isinstance (emoji_status , raw .types .EmojiStatus ):
58- return EmojiStatus (client = client , custom_emoji_id = emoji_status .document_id )
98+ return EmojiStatus (
99+ client = client ,
100+ custom_emoji_id = emoji_status .document_id ,
101+ until_date = utils .timestamp_to_datetime (getattr (emoji_status , "until" , None )),
102+ )
59103
60- if isinstance (emoji_status , raw .types .EmojiStatusUntil ):
104+ if isinstance (emoji_status , raw .types .EmojiStatusCollectible ):
61105 return EmojiStatus (
62106 client = client ,
63107 custom_emoji_id = emoji_status .document_id ,
64- until_date = utils .timestamp_to_datetime (emoji_status .until ),
108+ gift_id = emoji_status .collectible_id ,
109+ until_date = utils .timestamp_to_datetime (getattr (emoji_status , "until" , None )),
110+ title = emoji_status .title ,
111+ name = emoji_status .slug ,
112+ pattern_custom_emoji_id = emoji_status .pattern_document_id ,
113+ center_color = emoji_status .center_color ,
114+ edge_color = emoji_status .edge_color ,
115+ pattern_color = emoji_status .pattern_color ,
116+ text_color = emoji_status .text_color ,
65117 )
66118
67119 return None
68120
69121 def write (self ):
70- if self .until_date :
71- return raw .types .EmojiStatusUntil (
72- document_id = self .custom_emoji_id ,
73- until = utils .datetime_to_timestamp (self .until_date ),
122+ if self .gift_id :
123+ return raw .types .InputEmojiStatusCollectible (
124+ collectible_id = self .gift_id , until = utils .datetime_to_timestamp (self .until_date )
74125 )
75126
76- return raw .types .EmojiStatus (document_id = self .custom_emoji_id )
127+ return raw .types .EmojiStatus (
128+ document_id = self .custom_emoji_id , until = utils .datetime_to_timestamp (self .until_date )
129+ )
0 commit comments