@@ -23,6 +23,7 @@ def __init__(
2323 url : Optional [bool ] = None ,
2424 owner_id : Optional [int ] = None ,
2525 owner_type : Optional [str ] = None ,
26+ premium : Optional [bool ] = False
2627 ):
2728 super ().__init__ (app )
2829 self .id = id
@@ -39,6 +40,7 @@ def __init__(
3940 self .owner_id = owner_id
4041 self .url = url
4142 self .owner_type = owner_type
43+ self .premium = premium
4244
4345 @property
4446 def is_sticker (self ) -> bool :
@@ -57,6 +59,7 @@ def to_form_data(self):
5759 "mediaInfo.thumbnailUrl" : self .thumbnail_url ,
5860 "mediaInfo.sourceUri" : self .source_id ,
5961 "mediaInfo.typeName" : self .type_name ,
62+ "mediaInfo.premium" : self .premium
6063 }
6164
6265 def to_json (self ) -> JSONDict :
@@ -78,6 +81,7 @@ def to_json(self) -> JSONDict:
7881 "ownerType" : self .owner_type ,
7982 "downloadUrl" : self .url ,
8083 "url" : self .url ,
84+ "premium" : self .premium
8185 }.items ()
8286 if y
8387 }
@@ -99,7 +103,7 @@ def from_json(self, data: Optional[JSONDict] = None) -> "Media":
99103 self .owner_type = data .get ("ownerType" )
100104 if isinstance (self .owner_id , str ) and self .owner_id .isdigit ():
101105 self .owner_id = int (self .owner_id )
102-
106+ self . premium = data . get ( "premium" , False )
103107 return self
104108
105109 def to_update_request (self ):
@@ -114,6 +118,7 @@ def to_update_request(self):
114118 "fileName" : self .file_name ,
115119 "fileSize" : self .file_size ,
116120 "url" : self .url ,
121+ "premium" : self .premium
117122 }
118123
119124 async def edit (
0 commit comments