RockChinQ / QChatGPT

😎高稳定性、🧩支持扩展、🦄多模态的 ChatGPT QQ / QQ频道 / One Bot 机器人🤖 | 支持 OpenAI GPT、GPT 4o、Claude、Gemini Pro、DeepSeek、Moonshot(Kimi)、gpt4free、One API、Ollama 的 QQ / QQ频道 / OneBot 机器人 / Agent 平台
https://q.rkcn.top
GNU Affero General Public License v3.0
4.26k stars 331 forks source link

[Bug]: ctx.add_return("reply", [Voice(path=str(result))]) 回复语音文件时总是报错 #830

Closed smxy-lx closed 3 weeks ago

smxy-lx commented 3 months ago

部署方式

手动部署

消息平台适配器

aiocqhttp(使用 OneBot 协议接入的)

系统环境

window server 2022

Python环境

python 3.12

QChatGPT版本

v3.2.3

异常情况

from mirai import *
@handler(PersonNormalMessageReceived)
    async def person_normal_message_received(self, ctx: EventContext):
        msg = ctx.event.text_message
        if msg == '顶真' or msg == 'dz':
            self.logger.debug(f"你好")
            result = self.get_api_response(msg)
            path=str(result)
            print(path)
            if result:
                ctx.add_return("reply", [Voice(path=str(result))])
            ctx.prevent_default()

此处代码运行时报错,语音文件已下载到本地C:\Users\lx\AppData\Local\Temp\2\tmp7dm3cxxk.wav

[2024-06-27 17:14:20.061] C:\Users\lx\Desktop\bot\QChatGPT\pkg\pipeline\process\process.py (42) - [INFO] :
    处理 person_xxxxxxxxx 的请求(0): 顶真
C:\Users\lx\AppData\Local\Temp\2\tmp7dm3cxxk.wav
报错为:
[2024-06-27 17:14:31.738] C:\Users\lx\Desktop\bot\QChatGPT\pkg\pipeline\controller.py (152) - [ERROR] :
    处理请求时出错 query_id=0: <ActionFailed status='failed', retcode=200, data=None, echo={'seq': 1}>

    Voice是mirai中的方法

日志信息

[2024-06-27 17:14:20.061] C:\Users\lx\Desktop\bot\QChatGPT\pkg\pipeline\process\process.py (42) - [INFO] :
    处理 person_xxxxxxxxx 的请求(0): 顶真
C:\Users\lx\AppData\Local\Temp\2\tmp7dm3cxxk.wav
[2024-06-27 17:14:31.738] C:\Users\lx\Desktop\bot\QChatGPT\pkg\pipeline\controller.py (152) - [ERROR] :
    处理请求时出错 query_id=0: <ActionFailed status='failed', retcode=200, data=None, echo={'seq': 1}>

启用的插件

No response

RockChinQ commented 3 months ago

用的消息平台是哪个?能否发一下复现这个问题的语音文件?