lgc-NB2Dev / nonebot-plugin-picstatus

运行状态图片版 for NoneBot2 / A NoneBot2 plugin generates a picture which shows the status of current device
MIT License
119 stars 11 forks source link

获取状态失败,status.py:L65 bot.get_status() 为 None #30

Closed XZhouQD closed 1 year ago

XZhouQD commented 1 year ago

RT, 环境如下:

OS: Armbian (Ubuntu 22.04.3) Docker: 20.10.21 连接方式:icqq + yunzai + ws-plugin => Nonebot2 nonebot2==2.0.1 nonebot-adapter-onebot==2.2.3 nonebot-plugin-picstatus==0.5.1

我有点怀疑是不是这连接方式问题

clover_bot     | 07-31 02:13:01 [ERROR] nonebot_plugin_picstatus | 获取运行状态图失败
clover_bot     | Traceback (most recent call last):
clover_bot     |   File "/srv/clover_wiki_bot/bot.py", line 36, in <module>
clover_bot     |     nonebot.run()
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/__init__.py", line 333, in run
clover_bot     |     get_driver().run(*args, **kwargs)
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 199, in run
clover_bot     |     uvicorn.run(
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 587, in run
clover_bot     |     server.run()
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run
clover_bot     |     return asyncio.run(self.serve(sockets=sockets))
clover_bot     |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
clover_bot     |     return loop.run_until_complete(main)
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 467, in check_and_run_matcher
clover_bot     |     await _run_matcher(
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 419, in _run_matcher
clover_bot     |     await matcher.run(bot, event, state, stack, dependency_cache)
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 759, in run
clover_bot     |     await self.simple_run(bot, event, state, stack, dependency_cache)
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 734, in simple_run
clover_bot     |     await handler(
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
clover_bot     |     return await cast(Callable[..., Awaitable[R]], self.call)(**values)
clover_bot     | > File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_picstatus/__main__.py", line 119, in _
clover_bot     |     ret = await get_stat_pic(bot, pic)
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_picstatus/draw.py", line 462, in get_stat_pic
clover_bot     |     ) = await asyncio.gather(
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_picstatus/status.py", line 90, in get_header_data
clover_bot     |     (nick, msg_rec, msg_sent), avatar = await asyncio.gather(
clover_bot     |   File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_picstatus/status.py", line 65, in get_bot_status
clover_bot     |     bot_stat = (await bot.get_status()).get("stat")
clover_bot     | AttributeError: 'NoneType' object has no attribute 'get'
clover_bot     | 07-31 02:13:02 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_picstatus.__main__) running complete
lgc2333 commented 1 year ago

yunzai api 返回值问题 不想修,yunzai给我用YeNai-Plugin