zhulinyv / nonebot_plugin_hoshino_sign

一个从 hoshino 搬过来的 nonebot2 插件
GNU Affero General Public License v3.0
20 stars 1 forks source link

群员不存在 #13

Open Nenot233 opened 10 months ago

Nenot233 commented 10 months ago

10-30 11:19:08 [ERROR] nonebot | Running Matcher(type='message', module=extensive_plugin.nonebot_plugin_hoshino_sign, lineno=125) failed. Traceback (most recent call last): File "D:\BOT\zhenxun_bot\bot.py", line 22, in nonebot.run() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot__init.py", line 331, in run get_driver().run(*args, *kwargs) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", line 201, in run uvicorn.run( File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 578, in run server.run() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1906, in _run_once handle._run() File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 476, in check_and_run_matcher await _run_matcher( File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 428, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 846, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 821, in simple_run await handler( File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies__init.py", line 113, in call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "D:\BOT\zhenxun_bot\extensive_plugin\nonebot_plugin_hoshino_sign\init_.py", line 182, in rank_user = await get_user_card(bot, gid, str(i)) File "D:\BOT\zhenxun_bot\extensive_plugin\nonebot_plugin_hoshino_sign\utils.py", line 66, in get_user_card user_info: dict = await bot.get_group_member_info(group_id=group_id, user_id=qid) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\adapter\bot.py", line 123, in call_api raise exception File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api result = await self.adapter._call_api(self, api, data) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 140, in _call_api return handle_api_result(await self._result_store.fetch(seq, timeout)) File "C:\Users\550N\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\utils.py", line 58, in handle_api_result raise ActionFailed(result) nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(data=None, echo='2612', message='群员不存在', msg='MEMBER_NOT_FOUND', retcode=100, status='failed', wording='群员不存在')

zhulinyv commented 10 months ago

是否是在私聊或频道中使用排行榜?

Nenot233 commented 10 months ago

仅在群聊中使用

zhulinyv commented 10 months ago

我无法复现这个问题,请更换群聊尝试并提供复现过程。Image_1698847988833.png

RainbowDashKira commented 10 months ago

clone仓库更新了以后,我也出现这个报错,有两个群一个群可以正常使用另一个群会报错找不到群员,可以使用的群好感排行是乱序。

zhulinyv commented 10 months ago

是 bug 捏,周末回家改 Image_1699368373790.jpg

zhulinyv commented 10 months ago

果面那塞,米娜,孩子把有问题的代码先注释掉了,大致问题应该是 for 循环的地方,但实在是没有时间 debug,明天孩子要高考报名,15 号还有期中考试,实在抱歉,没有精力处理这个 bug,不确定什么时候可以修,欢迎大家 pr,也可以加入孩子的频道讨论,不定时在线,这个 issue 在解决前会一直保持开启。

zhulinyv commented 10 months ago

已修复,这个问题是由于有群员退群导致的,群员退群后,本地存的 *.json 文件里仍然存有数据,但在群中无法找到该群员。