NapNeko / NapCatQQ

现代化的基于 NTQQ 的 Bot 协议端实现
https://napcat.napneko.icu
Other
2.71k stars 197 forks source link

[BUG] 发送语音出现错误 #222

Closed HibiKier closed 3 months ago

HibiKier commented 3 months ago

系统版本

ubuntu20

QQNT 版本

当前一键脚本安装

NapCat 版本

1.8.4

OneBot 客户端

nonebot-adapter-onebot 2.3.1

发生了什么?

服务器上环境无法发送本地语音,其他环境或他人服务器上正常发送

如何复现

1.发送语音操作

期望的结果?

正常发送语音

NapCat 运行日志

发生错误 URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at uri2local (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:3916:18)
    at handleOb11FileLikeMessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22392:13)
    at Object.record (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22479:97)
    at createSendElements (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22570:46)
    at SendMsg._handle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22848:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SendMsg.websocketHandle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22277:23)
    at async ReverseWebsocket.onmessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27835:28)
    at async WebSocket.<anonymous> (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27875:7

OneBot 客户端运行日志

Traceback (most recent call last):
  File "/root/hibikibot/hibikibot2/bot.py", line 31, in <module>
    nonebot.run()
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
    await _run_matcher(
> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 428, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 850, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 825, in simple_run
    await handler(
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 94, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/root/hibikibot/hibikibot2/zhenxun/plugins/send_voice/dinggong.py", line 49, in _
    await UniMessage([Voice(path=path / voice)]).send()
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot_plugin_alconna/uniseg/message.py", line 1395, in send
    res = await fn.send_to(target, bot, msg, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot_plugin_alconna/uniseg/adapters/onebot11/exporter.py", line 155, in send_to
    return await bot.send(target, message, **kwargs)  # type: ignore
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py", line 237, in send
    return await self.__class__.send_handler(self, event, message, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py", line 190, in send
    return await bot.send_msg(**params)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 122, in call_api
    raise exception
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 97, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 147, in _call_api
    return handle_api_result(await self._result_store.fetch(seq, timeout))
  File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-gd47tcaV-py3.10/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result
    raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(status='failed', retcode=1200, data=None, message='URIError: URI malformed\n    at decodeURIComponent (<anonymous>)\n    at uri2local (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:3916:18)\n    at handleOb11FileLikeMessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22392:13)\n    at Object.record (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22479:97)\n    at createSendElements (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22570:46)\n    at SendMsg._handle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22848:15)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async SendMsg.websocketHandle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22277:23)\n    at async ReverseWebsocket.onmessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27835:28)\n    at async WebSocket.<anonymous> (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27875:7)', wording='URIError: URI malformed\n    at decodeURIComponent (<anonymous>)\n    at uri2local (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:3916:18)\n    at handleOb11FileLikeMessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22392:13)\n    at Object.record (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22479:97)\n    at createSendElements (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22570:46)\n    at SendMsg._handle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22848:15)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async SendMsg.websocketHandle (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:22277:23)\n    at async ReverseWebsocket.onmessage (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27835:28)\n    at async WebSocket.<anonymous> (file:///opt/QQ/resources/app/app_launcher/napcat/napcat.mjs:27875:7)', echo='78')
MliKiowa commented 3 months ago

给出原始post数据

MliKiowa commented 3 months ago

长期没有跟进 close