Yiyuiii/nonebot-plugin-moegoe

【报错】日语无法输出

Closed this issue · 2 comments

python3.9.13,nonebot2.0.0b5
中文没有问题,日语输出如下

指令

image

终端

[2022-08-21 23:18:58] [WARNING]: 转换CQ码 ({"type": "record", "data": {"file": "https://moegoe.azurewebsites.net/api/speak?08-21 23:18:58 [ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_moegoe, type=message, priority=5, temp=False> failed.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/usr/lib/python3.9/multiprocessing/spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 146, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 196, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 672, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 639, in simple_run
    await handler(
  File "/usr/local/lib/python3.9/dist-packages/nonebot/dependencies/__init__.py", line 92, in __call__
    return await self.call(**values)
  File "/usr/local/lib/python3.9/dist-packages/nonebot_plugin_moegoe/__init__.py", line 53, in _
    await jp_cmd.finish(jp_func(msg=msg, name=name))
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 468, in finish
    await cls.send(message, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 453, in send
    return await bot.send(event=event, message=_message, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/nonebot_plugin_guild_patch/__init__.py", line 30, in patched_send
    return await original_send(self, event, message, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/adapters/onebot/v11/bot.py", line 220, in send
    return await self.__class__.send_handler(self, event, message, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/adapters/onebot/v11/bot.py", line 175, in send
    return await bot.send_msg(**params)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/adapter/bot.py", line 117, in call_api
    raise exception
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/adapter/bot.py", line 94, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/adapters/onebot/v11/adapter.py", line 131, in _call_api
    return handle_api_result(
  File "/usr/local/lib/python3.9/dist-packages/nonebot/adapters/onebot/utils.py", line 47, in handle_api_result
    raise ActionFailed(**result)
nonebot.adapters.onebot.exception.ActionFailed: <ActionFailed data=None, echo=5, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>

gocq端

[2022-08-21 23:18:58] [WARNING]: 转换CQ码 ({"type": "record", "data": {"file": "https://moegoe.azurewebsites.net/api/speak?text=\u3059\u304d&id=2", "magic": null, "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: encode silk failed: convert pcm file error: exit status 1 将忽略本 段CQ码.
[2022-08-21 23:18:58] [WARNING]: 群消息发送失败: 消息为空.

更换了日语、韩语的api请求代码,测试可用,代码已经更新

谢谢大佬,没有问题了,而且输出错误可以提示了,
API调用失败:<ActionFailed data=None, echo=41, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>。请检查输入字符是否匹配语言。