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

FriendInputStatusChangedEvent : ValueError: Event has no message! #34

Closed
MikuPy2001 opened this issue Sep 1, 2022 · 4 comments · Fixed by #35
Closed

FriendInputStatusChangedEvent : ValueError: Event has no message! #34

MikuPy2001 opened this issue Sep 1, 2022 · 4 comments · Fixed by #35

Comments

@MikuPy2001
Copy link

MikuPy2001 commented Sep 1, 2022

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 ieew added the 新问题 label Sep 1, 2022
@ieew
Copy link
Owner

ieew commented Sep 1, 2022

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

@ieew
Copy link
Owner

ieew commented Sep 2, 2022

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

@wangyijin209
Copy link

是mirai-api的dev分支?

@ieew
Copy link
Owner

ieew commented Sep 4, 2022

@wangyijin209 mirai2的dev分支

@ieew ieew linked a pull request Sep 8, 2022 that will close this issue
@ieew ieew closed this as completed in #35 Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants