cscs181 / QQ-GitHub-Bot

GitHub Bot for QQ
MIT License
279 stars 42 forks source link

私聊使用 /install 后报错 #66

Closed INSide-734 closed 9 months ago

INSide-734 commented 9 months ago

系统: Ubuntu 20.04 Docker: 24.06 镜像版本: 2.1.3 使用QQ频道通信

Logs:

2023-12-30T09:58:38.956795128Z 12-30 17:58:38 [SUCCESS] nonebot | QQ 102082715 | [EventType.DIRECT_MESSAGE_CREATE]: Message 088dddabb296f6f2b3950110d690fddbaabb8fa501380948cdd3bfac06 from MagicMC: [Text(type='text', data={'text': '/install'})]
2023-12-30T09:58:39.019977508Z 12-30 17:58:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.github.plugins.github_install, lineno=37)
2023-12-30T09:58:39.920385349Z 12-30 17:58:39 [INFO] httpx | HTTP Request: POST https://api.sgroup.qq.com/dms/10765797397038296717/messages "HTTP/1.1 403 Forbidden"
2023-12-30T09:58:39.923047283Z 12-30 17:58:39 [INFO] nonebot | Matcher(type='message', module=src.plugins.github.plugins.github_install, lineno=37) running complete
2023-12-30T09:58:39.931981383Z 12-30 17:58:39 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.github.plugins.github_install, lineno=37) failed.
2023-12-30T09:58:39.932076415Z Traceback (most recent call last):
2023-12-30T09:58:39.932093864Z   File "/usr/local/bin/gunicorn", line 8, in <module>
2023-12-30T09:58:39.932103717Z     sys.exit(run())
2023-12-30T09:58:39.932111144Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
2023-12-30T09:58:39.932119098Z     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2023-12-30T09:58:39.932129361Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 236, in run
2023-12-30T09:58:39.932153631Z     super().run()
2023-12-30T09:58:39.932170036Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 72, in run
2023-12-30T09:58:39.932185631Z     Arbiter(self).run()
2023-12-30T09:58:39.932199523Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 202, in run
2023-12-30T09:58:39.932215524Z     self.manage_workers()
2023-12-30T09:58:39.932230367Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 571, in manage_workers
2023-12-30T09:58:39.932247813Z     self.spawn_workers()
2023-12-30T09:58:39.932263172Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 642, in spawn_workers
2023-12-30T09:58:39.932278141Z     self.spawn_worker()
2023-12-30T09:58:39.932303200Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
2023-12-30T09:58:39.932319608Z     worker.init_process()
2023-12-30T09:58:39.932336097Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/workers.py", line 66, in init_process
2023-12-30T09:58:39.932351121Z     super(UvicornWorker, self).init_process()
2023-12-30T09:58:39.932367581Z   File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 142, in init_process
2023-12-30T09:58:39.932385362Z     self.run()
2023-12-30T09:58:39.932400593Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/workers.py", line 98, in run
2023-12-30T09:58:39.932420064Z     return asyncio.run(self._serve())
2023-12-30T09:58:39.932437696Z   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2023-12-30T09:58:39.932454602Z     return runner.run(main)
2023-12-30T09:58:39.932521127Z   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2023-12-30T09:58:39.932542386Z     return self._loop.run_until_complete(task)
2023-12-30T09:58:39.932558530Z   File "/usr/local/lib/python3.11/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
2023-12-30T09:58:39.932575874Z     await _run_matcher(
2023-12-30T09:58:39.932591526Z > File "/usr/local/lib/python3.11/site-packages/nonebot/message.py", line 428, in _run_matcher
2023-12-30T09:58:39.932606992Z     await matcher.run(bot, event, state, stack, dependency_cache)
2023-12-30T09:58:39.932627420Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 846, in run
2023-12-30T09:58:39.932644263Z     await self.simple_run(bot, event, state, stack, dependency_cache)
2023-12-30T09:58:39.932660305Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 821, in simple_run
2023-12-30T09:58:39.932677432Z     await handler(
2023-12-30T09:58:39.932697690Z   File "/usr/local/lib/python3.11/site-packages/nonebot/dependencies/__init__.py", line 113, in __call__
2023-12-30T09:58:39.932714301Z     return await cast(Callable[..., Awaitable[R]], self.call)(**values)
2023-12-30T09:58:39.932729890Z   File "/app/src/plugins/github/plugins/github_install/__init__.py", line 53, in handle_private
2023-12-30T09:58:39.932745555Z     await install.finish(
2023-12-30T09:58:39.932760900Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 570, in finish
2023-12-30T09:58:39.932777184Z     await cls.send(message, **kwargs)
2023-12-30T09:58:39.932791878Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 554, in send
2023-12-30T09:58:39.932808436Z     return await bot.send(event=event, message=_message, **kwargs)
2023-12-30T09:58:39.932823136Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/bot.py", line 481, in send
2023-12-30T09:58:39.932837900Z     return await self.send_to_dms(
2023-12-30T09:58:39.932854974Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/bot.py", line 347, in send_to_dms
2023-12-30T09:58:39.932881943Z     return await self.post_dms_messages(
2023-12-30T09:58:39.932992317Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/adapter/bot.py", line 123, in call_api
2023-12-30T09:58:39.933225580Z     raise exception
2023-12-30T09:58:39.933378034Z   File "/usr/local/lib/python3.11/site-packages/nonebot/internal/adapter/bot.py", line 98, in call_api
2023-12-30T09:58:39.933526954Z     result = await self.adapter._call_api(self, api, **data)
2023-12-30T09:58:39.933701966Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/adapter.py", line 416, in _call_api
2023-12-30T09:58:39.933798252Z     return await api_handler(bot, **data)
2023-12-30T09:58:39.933996039Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/utils.py", line 64, in __call__
2023-12-30T09:58:39.934185685Z     return await self.func(inst, *args, **kwds)
2023-12-30T09:58:39.934314738Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/bot.py", line 1079, in post_dms_messages
2023-12-30T09:58:39.934479042Z     return parse_obj_as(GuildMessage, await self._request(request))
2023-12-30T09:58:39.934677957Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/bot.py", line 549, in _request
2023-12-30T09:58:39.934921948Z     return self._handle_response(response)
2023-12-30T09:58:39.935065234Z   File "/usr/local/lib/python3.11/site-packages/nonebot/adapters/qq/bot.py", line 538, in _handle_response
2023-12-30T09:58:39.935214018Z     raise ActionFailed(response)
2023-12-30T09:58:39.935346662Z nonebot.adapters.qq.exception.ActionFailed: <ActionFailed: 403, code=304003, message=url not allowed, trace_id=0868b2b9dae353cd4188faf30f332625>
yanyongyu commented 9 months ago

url not allowed是因为你没有报备URL机器人不允许发送链接

INSide-734 commented 9 months ago

好的,打扰了

INSide-734 commented 9 months ago

使用 Lagrange.Core 作为无头客户端的话,客户端能收到私聊信息,但是Bot端却没有显示,这是怎么回事呢

yanyongyu commented 9 months ago

请提供nb的日志