@@ -78,15 +78,11 @@ async def get_custom_emoji_packs(
7878
7979 if query and query .strip ():
8080 result = await cl (
81- functions .messages .SearchEmojiStickerSetsRequest (
82- q = query .strip (), hash = 0
83- )
81+ functions .messages .SearchEmojiStickerSetsRequest (q = query .strip (), hash = 0 )
8482 )
8583 raw_sets = getattr (result , "sets" , []) or []
8684 elif featured :
87- result = await cl (
88- functions .messages .GetFeaturedEmojiStickersRequest (hash = 0 )
89- )
85+ result = await cl (functions .messages .GetFeaturedEmojiStickersRequest (hash = 0 ))
9086 raw_sets = getattr (result , "sets" , []) or []
9187 else :
9288 result = await cl (functions .messages .GetEmojiStickersRequest (hash = 0 ))
@@ -200,19 +196,13 @@ async def get_custom_emoji_pack(
200196 alt = getattr (attr , "alt" , alt ) or alt
201197
202198 mime_type = getattr (doc , "mime_type" , "" )
203- is_animated = (
204- mime_type == "application/x-tgsticker"
205- or any (
206- isinstance (a , types .DocumentAttributeAnimated )
207- for a in getattr (doc , "attributes" , []) or []
208- )
199+ is_animated = mime_type == "application/x-tgsticker" or any (
200+ isinstance (a , types .DocumentAttributeAnimated )
201+ for a in getattr (doc , "attributes" , []) or []
209202 )
210- is_video = (
211- mime_type == "video/webm"
212- or any (
213- isinstance (a , types .DocumentAttributeVideo )
214- for a in getattr (doc , "attributes" , []) or []
215- )
203+ is_video = mime_type == "video/webm" or any (
204+ isinstance (a , types .DocumentAttributeVideo )
205+ for a in getattr (doc , "attributes" , []) or []
216206 )
217207 if is_animated :
218208 fmt = "animated"
@@ -233,9 +223,7 @@ async def get_custom_emoji_pack(
233223 }
234224 )
235225
236- return json .dumps (
237- {"pack" : pack_info , "emojis" : emojis }, indent = 2 , default = json_serializer
238- )
226+ return json .dumps ({"pack" : pack_info , "emojis" : emojis }, indent = 2 , default = json_serializer )
239227 except Exception as e :
240228 return log_and_format_error ("get_custom_emoji_pack" , e , pack = pack )
241229
@@ -273,9 +261,7 @@ async def preview_custom_emoji(
273261 cl = get_client (account )
274262 await ensure_connected (cl )
275263
276- docs = await cl (
277- functions .messages .GetCustomEmojiDocumentsRequest (document_id = [doc_id ])
278- )
264+ docs = await cl (functions .messages .GetCustomEmojiDocumentsRequest (document_id = [doc_id ]))
279265 if not docs :
280266 return f"Custom emoji with document ID { doc_id } not found."
281267
0 commit comments