Closed PackageInstaller closed 1 year ago
影响使用不,我看后面代码都执行了
除了语音方面报错(好像是nb的原因),其他正常,感谢大佬
好像只有这个插件的语音无法发出,真寻自带的钉宫语音是能正常发送出去,具体报错如图,麻烦大佬帮我看看
go-cqhttp给的是这个warning
[2023-01-19 17:36:45] [WARNING]: 转换CQ码 ({"type": "record", "data": {"file": "https://static.prts.wiki/voice/char_388_mint/CN_034.wav?filename=\u6233\u4e00\u4e0b.wav", "magic": null, "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: encode silk failed: convert pcm file error: exit status 1 将忽略本段CQ码. [2023-01-19 17:36:45] [WARNING]: 群消息发送失败: 消息为空.
不过你这个还是unicode码没转成中文
1027行之后加 url_voice_cn = url_voice_cn.encode("unicode_escape").decode('unicode_escape') url_voice_jp = url_voice_jp.encode("unicode_escape").decode('unicode_escape') voice_text = voice_text.encode("unicode_escape").decode('unicode_escape')
注意对齐
啊,加了还是报错(还是之前那个),指令是方舟猜语音
那网上搜搜怎么将unicode转成字符,大概是把decode改成encode("utf-8")
啊,我不会啊
decode("unicode_escape")换成encode("utf-8")试试
加了之后发送指令方舟猜语音,报错如下,机器人回复:网络问题,请稍后再试(我网络正常,挂不挂梯都是这个报错)
01-20 19:06:08 [ERROR] nonebot | Running Matcher(type='message', module=extensive_plugin.draw_helper) failed.
Traceback (most recent call last):
File "/home/Neko/QQBot/zhenxun_bot/bot.py", line 21, in
File "/home/Neko/.cache/pypoetry/virtualenvs/zhenxun-bot-PzlhPUjk-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 188, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/home/Neko/.cache/pypoetry/virtualenvs/zhenxun-bot-PzlhPUjk-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/home/Neko/.cache/pypoetry/virtualenvs/zhenxun-bot-PzlhPUjk-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run await handler( File "/home/Neko/.cache/pypoetry/virtualenvs/zhenxun-bot-PzlhPUjk-py3.10/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "/home/Neko/QQBot/zhenxun_bot/extensive_plugin/drawhelper/init.py", line 254, in list_voice.remove(list_voice[2]) UnboundLocalError: local variable 'list_voice' referenced before assignment
可能随机到那些预备干员了了,预备干员是没有语音的
其他有发出来么
不行
那自己百度一下怎么python怎么将unicode码转成字符串吧,然后测试测试吧(回家没有电脑
好吧,我试试(
非常抱歉经过多次测试,不是上述问题,gocq会将我的中文变成unicode,现已经变为文件流发送而不是网址发送
好的,我去试试,祝大佬新年快乐啊
感谢大佬,没问题了