报错信息如图所示

详细的报错信息在下面:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\multiprocessing\spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\uvicorn\_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\asyncio\base_events.py", line 1899, in _run_once
handle._run()
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\message.py", line 188, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\dependencies\__init__.py", line 108, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\123\PycharmProjects\pyBot\PyNonebot\src\plugins\群人数减少.py", line 51, in handle_first_receive
await bot.call_api("send_group_msg1", group_id=event.group_id, message=rely)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
return handle_api_result(await self._result_store.fetch(seq, timeout))
File "D:\apache-tomcat-9.0.53-windows-x64\Anaconda\envs\pyBot\lib\site-packages\nonebot\adapters\onebot\v11\utils.py", line 58, in handle_api_result
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed
排错的几种方式
这种情况排错方式有以下几种:
- 排查go-cqhttp控制台,看是否有报错或者警告
- go-cqhttp控制台没有警告,检查自己的插件调用go-cqhttp接口时接口名是否写错,参数是否写错
- 找出关键性报错,去社区找答案(如文章标题就是关键性报错,可以在CSDN或者stackoverflow找答案)
- 使用print语句,打印数据,看是否正常
- 断点调试(好用,但调试起来可能有点麻烦)
如果你在编写Nonebot机器人时遇到了问题经过上面几种排错依旧排不掉,可以评论区留下你的错误,我会定期去看。
文章详细记录了一次PythonNonebot机器人在运行时遇到的ActionFailed异常的报错信息,包括错误堆栈跟踪。作者提出了几种排错方法,如检查go-cqhttp控制台、确认接口和参数无误、在社区搜索相似问题、使用print调试以及断点调试。如果读者在使用Nonebot时遇到类似问题,文章提供了可能的解决方案和求助途径。
4342

被折叠的 条评论
为什么被折叠?



