KroMiose / nonebot_plugin_naturel_gpt

一个基于NoneBot框架的Ai聊天插件,对接OpenAi文本生成接口,实现了机器人的人格 自定义/切换,聊天记忆等功能
Apache License 2.0
471 stars 52 forks source link

[bug]群@全体成员时解析QQ号错误 #102

Closed dixiatielu closed 1 year ago

dixiatielu commented 1 year ago

@全体成员时有qq=all,故报以下错误:

03-25 17:55:49 [SUCCESS] nonebot | OneBot V11xxxx | [message.group.normal]: Message XXXX from XXXX@[群:XXXX] '[at:qq=all] '
03-25 17:55:50 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_naturel_gpt.matcher)
03-25 17:55:50 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_naturel_gpt.matcher)
03-25 17:55:50 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_naturel_gpt.matcher) running complete
03-25 17:55:50 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_naturel_gpt.matcher) failed.
Traceback (most recent call last):
  File "<string>", line 33, in <module>
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run
    uvicorn.run(
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/message.py", line 141, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
    await handler(
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot_plugin_naturel_gpt/matcher.py", line 97, in handler
    await gen_chat_text(event=event, bot=bot),
  File "/root/dxtl_bot/dxtlBot/.venv/lib/python3.10/site-packages/nonebot_plugin_naturel_gpt/utils.py", line 62, in gen_chat_text
    user_name = await get_user_name(event=event, bot=bot,user_id=int(qq))
ValueError: invalid literal for int() with base 10: 'all'
KroMiose commented 1 year ago

感谢反馈,计划进行修正