ieew / nonebot_adapter_mirai2

nonebot2 的三方 adapter,用以为 nonebot2 提供 MiraiApiHttp2 协议支持
https://ieew.github.io/nonebot_adapter_mirai2/
GNU Affero General Public License v3.0
20 stars 6 forks source link

FriendInputStatusChangedEvent : ValueError: Event has no message! #34

Closed MikuPy2001 closed 2 years ago

MikuPy2001 commented 2 years ago
09-01 19:46:35 [SUCCESS] nonebot | MIRAI V2 **** | [FriendInputStatusChangedEvent]: {'self_id': ****, 'type': 'FriendInputStatusChangedEvent', 'inputting': False, 'friend': {'id': ****, 'nickname': 'むきゆー', 'remark': 'むきゆー'}}
09-01 19:46:35 [WARNING] nonebot | Error while parsing command for event
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Program\Files\python\38\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "D:\Program\Files\python\38\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "D:\Program\Files\python\38\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "D:\Program\Files\python\38\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\uvicorn\_subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "D:\Program\Files\python\38\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 1859, in _run_once
    handle._run()
  File "D:\Program\Files\python\38\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\adapters\mirai2\utils.py", line 71, in process_event
    await handle_event(bot, event)
> File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\message.py", line 293, in handle_event
    TrieRule.get_value(bot, event, state)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\rule.py", line 79, in get_value
    if event.get_type() != "message":
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\adapters\mirai2\event\base.py", line 104, in get_type
    raise ValueError("Event has no message!")
ValueError: Event has no message!
09-01 19:46:35 [DEBUG] nonebot | Checking for matchers in priority 1...
09-01 19:46:35 [ERROR] nonebot | Rule check failed for <Matcher from plugins.群好友刷新, type=message, priority=1, temp=False>.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Program\Files\python\38\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "D:\Program\Files\python\38\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "D:\Program\Files\python\38\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "D:\Program\Files\python\38\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\uvicorn\_subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "D:\Program\Files\python\38\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "D:\Program\Files\python\38\lib\asyncio\base_events.py", line 1859, in _run_once
    handle._run()
  File "D:\Program\Files\python\38\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
> File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\message.py", line 130, in _check_matcher
    if not await Matcher.check_perm(
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\internal\matcher.py", line 272, in check_perm
    event_type = event.get_type()
  File "D:\_个人\python项目\机器人插件环境\venv\Lib\site-packages\nonebot\adapters\mirai2\event\base.py", line 104, in get_type
    raise ValueError("Event has no message!")
ValueError: Event has no message!
ieew commented 2 years ago

一个新的事件,已知类似事件有 FriendInputStatusChangedEvent FriendNickChangedEvent BotLeaveEventDisband MemberHonorChangeEvent OtherClientOnlineEvent OtherClientOfflineEvent CommandExecutedEvent 待适配

ieew commented 2 years ago

我刚刚在 dev 分支提交了一点东西,我觉得你可以试试看

wangyijin209 commented 2 years ago

是mirai-api的dev分支?

ieew commented 2 years ago

@wangyijin209 mirai2的dev分支