@@ -823,7 +823,7 @@ async def build_sticker_message(
823
823
)
824
824
io_save .seek (0 )
825
825
else :
826
- with AFFmpeg (sticker ) as ffmpeg :
826
+ async with AFFmpeg (sticker ) as ffmpeg :
827
827
animated = True
828
828
sticker = await ffmpeg .cv_to_webp ()
829
829
io_save = BytesIO (sticker )
@@ -905,7 +905,7 @@ async def build_video_message(
905
905
io = BytesIO (await get_bytes_from_name_or_url_async (file ))
906
906
io .seek (0 )
907
907
buff = io .read ()
908
- with AFFmpeg (file ) as ffmpeg :
908
+ async with AFFmpeg (file ) as ffmpeg :
909
909
duration = int ((await ffmpeg .extract_info ()).format .duration )
910
910
thumbnail = await ffmpeg .extract_thumbnail ()
911
911
upload = await self .upload (buff )
@@ -1070,7 +1070,7 @@ async def build_audio_message(
1070
1070
io .seek (0 )
1071
1071
buff = io .read ()
1072
1072
upload = await self .upload (buff )
1073
- with AFFmpeg (io .getvalue ()) as ffmpeg :
1073
+ async with AFFmpeg (io .getvalue ()) as ffmpeg :
1074
1074
duration = int ((await ffmpeg .extract_info ()).format .duration )
1075
1075
message = Message (
1076
1076
audioMessage = AudioMessage (
@@ -2755,7 +2755,7 @@ def get_all_devices(self) -> List["Device"]:
2755
2755
return self .get_all_devices_from_db (self .database_name )
2756
2756
2757
2757
def new_client (
2758
- self , jid : JID = None , uuid : str = None , props : Optional [DeviceProps ] = None
2758
+ self , jid : Optional [ JID ] = None , uuid : Optional [ str ] = None , props : Optional [DeviceProps ] = None
2759
2759
) -> NewAClient :
2760
2760
"""
2761
2761
This function creates a new instance of the client. If the jid parameter is not provided, a new client will be created.
@@ -2769,7 +2769,7 @@ def new_client(
2769
2769
:type props: Optional[DeviceProps]
2770
2770
"""
2771
2771
2772
- if not jid and not uuid :
2772
+ if jid is None and uuid is None :
2773
2773
# you must at least provide a uuid to make sure the client is unique
2774
2774
raise Exception ("JID and UUID cannot be none" )
2775
2775
0 commit comments