Harry-Jing / nonebot-plugin-bing-chat

一个可以使用新版Bing进行聊天的NoneBot插件
GNU General Public License v3.0
168 stars 12 forks source link

KeyError: 'messages' #34

Closed saferabbit closed 1 year ago

saferabbit commented 1 year ago

日志报错: File "/home/zhenxun_bot/bot.py", line 22, in nonebot.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/init.py", line 273, in run get_driver().run(*args, **kwargs) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 172, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run server.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/root/.pyenv/versions/3.10.10/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/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/zhenxun-bot-UH4sDRIh-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 "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-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 "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-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/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/onebotv11/main.py", line 91, in bing_chat_command_chat raise exc File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/onebotv11/main.py", line 82, in bing_chat_command_chat response = await chatbot.ask( File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/bing.py", line 279, in ask async for final, response in self.chat_hub.ask_stream( File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/bing.py", line 242, in ask_stream yield False, response["arguments"][0]["messages"][0][ KeyError: 'messages'

系统:Ubuntu20.04 Python版本:3.10.10 问题描述: 是否需要梯子才能获取信息?还有那个cookies.json这个是新建在bot的data文件夹里面的是吗?

Harry-Jing commented 1 year ago

不需要梯子 ./data/BingChat/cookies.json

你需要升级到最新版