CMHopeSunshine / LittlePaimon

小派蒙!基于Nonebot2的原神机器人,包括但不限于UID面板查询、抽卡记录分析、游戏攻略图鉴、实时便签、原石札记、群聊学习、群管等功能。/ LittlePamon! Genshin Impact multifunctional bot based on Nonebot2.
https://docs.paimon.cherishmoon.top
GNU Affero General Public License v3.0
1.15k stars 127 forks source link

[问题]安装ffmpeg后,猜语音功能gocq仍无法识别到有ffmpeg #360

Closed fangyuanshisan closed 1 year ago

fangyuanshisan commented 1 year ago
image

服务器已安装ffmpeg,但是机器人猜语音还是提示 发送语音失败,请检查是否已安装FFmpeg

CMHopeSunshine commented 1 year ago

有重启bot吗,装完且确认已添加到环境变量中后,要刷新一下终端并重启bot

fangyuanshisan commented 1 year ago

有重启过,这台服务器之前有装过bot,这次是新装

CMHopeSunshine commented 1 year ago

这问题一般是gocq识别不到你的环境中有ffmpeg,如果你真的确定已经安装且添加到了环境变量但仍识别不到,建议向go-cqhttp仓库发issue

fangyuanshisan commented 1 year ago

01-07 11:17:42 [WARNING] nonebot_plugin_gocqhttp | [1656383945] 转换CQ码 ({"type": "record", "data": {"file": "https://uploadstatic.mihoyo.com/ys-obc/2022/05/13/6276411/0007e1b32be404d89ed73b2a1a84163b_3580006290427929872.mp3", "magic": null, "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: encode silk failed: convert pcm file error: exit status 1 将忽略本段CQ码.

这块是最后的报错

CMHopeSunshine commented 1 year ago

那很明显就是go-cqhttp的问题了,nonebot已经将语音链接发送给go-cqhttp了,go-cqhttp自己报错导致发不出来

CMHopeSunshine commented 1 year ago

看了go-cqhttp的issue,确实有同样的问题,https://github.com/Mrs4s/go-cqhttp/issues/1831

fangyuanshisan commented 1 year ago

感谢指路.辛苦啦

fangyuanshisan commented 1 year ago

你好,作者大大,看到已经修复 是怎么处理的

CMHopeSunshine commented 1 year ago

你好,作者大大,看到已经修复 是怎么处理的

由nonebot这边把语音下载下来再发送给go-cqhttp

fangyuanshisan commented 1 year ago

我这边应该怎么办呢 更新还是自己修改

CMHopeSunshine commented 1 year ago

更新就行了

fangyuanshisan commented 1 year ago

emmm 现在go-cqhttp好像没启动,后台qq显示未知

CMHopeSunshine commented 1 year ago

那就启动呗,启动后刷新页面就能看到qq

fangyuanshisan commented 1 year ago

需要单独启动吗

fangyuanshisan commented 1 year ago

nohup nb run > runbot.log 2>&1 & 我的启动命令

CMHopeSunshine commented 1 year ago

你原本是怎么启动的那就怎么启动

fangyuanshisan commented 1 year ago

我安装后 更新最新的版本

fangyuanshisan commented 1 year ago

需要怎么启动

CMHopeSunshine commented 1 year ago

你说的是nonebot还是go-cqhttp还是插件版gocq啊,你原本是怎么启动的那就怎么启动,和版本没关系

fangyuanshisan commented 1 year ago

我单独没有安装,我一直用的是派蒙的bot 但是 机器人启动了,web也启动了 , 就是添加账号那个页面 "detail": "Not Found" 之前是好着呢 我web后台更新了下 就不行了 服务器已经重启过了

CMHopeSunshine commented 1 year ago

poetry run nb plugin install nonebot-plugin-gocqhttp

fangyuanshisan commented 1 year ago

执行后,好像是可以了 我没搞懂中间的关系 不好意思!! 原神语音ai生成也有问题

1-10 17:18:57 [SUCCESS] nonebot | OneBot V11 1656383945 | [message.group.normal]: Message -1639603624 from 1147221290@[群:818679140] "原神语音迪卢克列表" 01-10 17:18:57 [INFO] nonebot | Event will be handled by Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) 01-10 17:18:58 [WARNING] nonebot_plugin_gocqhttp | [1656383945] 转换CQ码 ({"type": "record", "data": {"file": "https://uploadstatic.mihoyo.com/ys-obc/2022/05/12/6276411/c91df4f30a60035e1de3a115b7ac0c88_3317202904822872928.mp3", "magic": null, "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: encode silk failed: convert pcm file error: exit status 1 将忽略本段CQ码. 01-10 17:18:58 [WARNING] nonebot_plugin_gocqhttp | [1656383945] 群消息发送失败: 消息为空. 01-10 17:18:58 [INFO] nonebot | Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) running complete 01-10 17:18:58 [ERROR] nonebot | Running Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) failed. Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/bin/nb", line 8, in sys.exit(main()) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, *kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nb_cli/commands/main.py", line 30, in run run_bot(file, app) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nb_cli/handlers/deploy.py", line 25, in run_bot nonebot.run(app=f"{module_name}:{app}") File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 273, in run get_driver().run(args, **kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 172, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 576, in run server.run() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 688, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "/root/miaowujiang/./LittlePaimon/plugins/GenshinVoice/init.py", line 86, in await get_voice.finish(MessageBuild.Record(random.choice(voices).voice_url)) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 473, in finish await cls.send(message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 458, in send return await bot.send(event=event, message=_message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 219, in send return await self.class.send_handler(self, event, message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 174, in send return await bot.send_msg(params) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 116, in call_api raise exception File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 94, in call_api result = await self.adapter._call_api(self, api, data) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 132, in _call_api return handle_api_result( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result raise ActionFailed(result) nonebot.adapters.onebot.v11.exception.ActionFailed 01-10 17:20:14 [INFO] nonebot_plugin_gocqhttp | [1656383945] 收到群 (许愿猫猫,宴色vd在(818679140) 内 方墨砚(1147221290) 的消息: 原神语音迪卢克中 (122483682) 01-10 17:20:14 [SUCCESS] nonebot | OneBot V11 1656383945 | [message.group.normal]: Message 122483682 from 1147221290@[群:818679140] "原神语音迪卢克中" 01-10 17:20:14 [INFO] nonebot | Event will be handled by Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) 01-10 17:20:14 [WARNING] nonebot_plugin_gocqhttp | [1656383945] 转换CQ码 ({"type": "record", "data": {"file": "https://uploadstatic.mihoyo.com/ys-obc/2022/05/12/6276411/a0df610dd4484fd3f8b1321e142e4cbf_5733209472105932558.mp3", "magic": null, "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: encode silk failed: convert pcm file error: exit status 1 将忽略本段CQ码. 01-10 17:20:14 [WARNING] nonebot_plugin_gocqhttp | [1656383945] 群消息发送失败: 消息为空. 01-10 17:20:14 [INFO] nonebot | Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) running complete 01-10 17:20:14 [ERROR] nonebot | Running Matcher(type='message', module=LittlePaimon.plugins.Genshin_Voice) failed. Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/bin/nb", line 8, in sys.exit(main()) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nb_cli/commands/main.py", line 30, in run run_bot(file, app) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nb_cli/handlers/deploy.py", line 25, in run_bot nonebot.run(app=f"{module_name}:{app}") File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 273, in run get_driver().run(*args, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 172, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 576, in run server.run() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 688, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "/root/miaowujiang/./LittlePaimon/plugins/GenshinVoice/init.py", line 86, in await get_voice.finish(MessageBuild.Record(random.choice(voices).voice_url)) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 473, in finish await cls.send(message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 458, in send return await bot.send(event=event, message=_message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 219, in send return await self.class.send_handler(self, event, message, kwargs) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 174, in send return await bot.send_msg(params) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 116, in call_api raise exception File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 94, in call_api result = await self.adapter._call_api(self, api, data) File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 132, in _call_api return handle_api_result( File "/root/.cache/pypoetry/virtualenvs/littlepaimon-sRNWwX3p-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result raise ActionFailed(result) nonebot.adapters.onebot.v11.exception.ActionFailed

CMHopeSunshine commented 1 year ago

7a486c952923c12f194948ea47ea72b3003e5f7d 已修

CMHopeSunshine commented 1 year ago

没问题了的话就close了