Closed dmnoobcoder closed 1 month ago
没看太懂啊,你这个是让bot申请进群的操作?为什么会出现group_id是属于bot的情况?如果不在一个群组bot也收不到消息吧
就是给bot发送加群邀请,期待bot自动同意进群
这个功能我确实me没有做,因为我功能描述是标注了,权限为管理员/群主下,自动处理流程,而不是对于主动添加进群聊的流程处理。
因为这个操作曾导致我一个账号永久封禁,我理由是短时间内太多加群请求加上之前累计的操作,所以出于安全考虑,我只做了比较安全合理的操作请求,进群邀请等等容易被系统鉴定为传销等等的,个人建议自己登录Bot设置进群邀请的权限来控制,或者自行修改,作为开源项目我不应该编写容易导致他人封禁的行为
好吧 不好意思 我理解错了,打扰了。我以为是远程同意进群邀请
nonebot2, onebot11, fastAPI 请求大佬有空的时候帮忙看一眼,万分感谢!
发送加群邀请后,报错如下: 10-30 20:30:46 [ERROR] nonebot | Running Matcher(type='request', module=nonebot_plugin_friends.matcher, lineno=27) failed. Traceback (most recent call last): File "", line 15, in
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/init.py", line 335, in run
get_driver().run(*args, **kwargs)
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
uvicorn.run(
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 579, in run
server.run()
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
await _run_matcher(
以下是我试图揣摩这个issue的过程,或许有帮助,也发出来供参考: 我的python水平很差,猜测可能是89行这里试图给将要加但还没加的这个群聊发消息出错了: logger.info(f"发送到群聊{add_group}") add_message: int = ( await bot.send_group_msg( group_id=int(add_group), message=Message( f"QQ:{add_qq} 请求请入本群!\n请求添加时间:{realtime}\n验证信息为:{add_comment}", ), ) )["message_id"] 遂改group_id为一个已经加过的群聊重新尝试,报错如下: 10-30 20:40:17 [ERROR] nonebot | Running Matcher(type='request', module=nonebot_plugin_friends.matcher, lineno=27) failed. Traceback (most recent call last): File "", line 15, in
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/init.py", line 335, in run
get_driver().run(*args, **kwargs)
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
uvicorn.run(
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 579, in run
server.run()
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/home/su/qqbot/nl_annon/.venv/lib/python3.12/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
await _run_matcher(
顿首再拜