Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-cqhttp 部署方式频道消息报错:ValueError: Event has no message! #25

Open
sgpublic opened this issue Nov 27, 2023 · 1 comment

Comments

@sgpublic
Copy link

日志如下:

11-27 11:58:02 [SUCCESS] nonebot | OneBot V11 3206547851 | [message]: {'time': 1701086280, 'self_id': xxx, 'post_type': 'message', 'self_tiny_id': 'xxxx', 'message_type': 'guild', 'guild_id': 'xxxx', 'sub_type': 'channel', 'sender': {'nickname': '忆丶距', 'tiny_id': 'xxxx', 'user_id': xxxx}, 'message': 'srhelp', 'channel_id': 'xxxx', 'user_id': 'xxxx', 'message_id': 'xxxx'}
11-27 11:58:02 [WARNING] nonebot | Error while parsing command for event
Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/__init__.py", line 331, in run
    get_driver().run(*args, **kwargs)
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/drivers/fastapi.py", line 201, in run
    uvicorn.run(
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/main.py", line 587, in run
    server.run()
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/adapters/onebot/v11/bot.py", line 198, in handle_event
    await handle_event(self, event)
> File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/message.py", line 524, in handle_event
    TrieRule.get_value(bot, event, state)
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/rule.py", line 104, in get_value
    message = event.get_message()
  File "/home/poetry-runner/.cache/pypoetry/virtualenvs/march7th-9TtSrW0h-py3.11/lib/python3.11/site-packages/nonebot/adapters/onebot/v11/event.py", line 49, in get_message
    raise ValueError("Event has no message!")
ValueError: Event has no message!

个人理解似乎是 nonebot-plugin-send-anything-anywhere 的问题,但鄙人对 python 不是很熟就交由大佬判断了(doge

@mobyw
Copy link
Member

mobyw commented Nov 27, 2023

nonebot-plugin-send-anything-anywhere 的 OneBot v11 不支持 QQ 频道,可以使用 QQ 频道适配器或等 MountainDash/nonebot-plugin-send-anything-anywhere #105 合并后使用 QQ 适配器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants