添加聊天功能
This commit is contained in:
@@ -280,7 +280,7 @@ class MessageMixin(WechatAPIClientBase):
|
||||
else:
|
||||
self.error_handler(json_resp)
|
||||
|
||||
async def send_voice_message(self, wxid: str, voice: Union[str, bytes, os.PathLike], format: str = "AMR") -> \
|
||||
async def send_voice_message(self, wxid: str, voice: Union[str, bytes, os.PathLike], format: str = "amr") -> \
|
||||
tuple[int, int, int]:
|
||||
"""发送语音消息。
|
||||
|
||||
@@ -300,12 +300,12 @@ class MessageMixin(WechatAPIClientBase):
|
||||
"""
|
||||
return await self._queue_message(self._send_voice_message, wxid, voice, format)
|
||||
|
||||
async def _send_voice_message(self, wxid: str, voice: Union[str, bytes, os.PathLike], format: str = "AMR") -> \
|
||||
async def _send_voice_message(self, wxid: str, voice: Union[str, bytes, os.PathLike], format: str = "mar") -> \
|
||||
tuple[int, int, int]:
|
||||
if not self.wxid:
|
||||
raise UserLoggedOut("请先登录")
|
||||
|
||||
elif format not in ["AMR", "WAVE", "MP3", "SILK", "SPEEX"]:
|
||||
elif format not in ["amr", "wave", "mp3", "silk", "speex"]:
|
||||
raise ValueError("format must be one of amr, wav, mp3")
|
||||
|
||||
# read voice to byte
|
||||
|
||||
Reference in New Issue
Block a user