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

接收到@消息会报错 #14

Closed fatinghenji closed 2 years ago

fatinghenji commented 2 years ago

nb控制台日志:

Task exception was never retrieved
future: <Task finished name='Task-86' coro=<process_event() done, defined at /usr/local/lib/python3.8/dist-packages/nonebot/adapters/mirai2/utils.py:96> exception=AttributeError("'NoneType' object has no attribute 'type'")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/nonebot/adapters/mirai2/utils.py", line 103, in process_event
    event = process_at(bot, event)
  File "/usr/local/lib/python3.8/dist-packages/nonebot/adapters/mirai2/utils.py", line 60, in process_at
    at = event.message_chain.extract_first(MessageType.AT)
  File "/usr/local/lib/python3.8/dist-packages/nonebot/adapters/mirai2/message.py", line 408, in extract_first
    if (not type) or (first.type in type):
AttributeError: 'NoneType' object has no attribute 'type'

nb版本:2.0.0-beta.2 mirai-http-api版本:2.4.0

ieew commented 2 years ago

大概知道什么回事了,不过还是希望你提供一下触发这个bug时的消息内容

fatinghenji commented 2 years ago

大概知道什么回事了,不过还是希望你提供一下触发这个bug时的消息内容

@bot 搜图

fatinghenji commented 2 years ago

补充: 貌似不仅仅是@消息报错,gif图片也报错 image 注意右上及左下两个窗口

ieew commented 2 years ago

我这并不能测试出你的bug...

fatinghenji commented 2 years ago

(太怪了,需要我进一步提供什么吗?

ieew commented 2 years ago

提供一下你的 adapter 版本号以及 该功能所属插件的 指令或消息 装饰器的代码之类的让我看看吧.....(你也可以在 nb 群找一个叫 pip install nonebot_adapter_mirai2 的人(类似名字的人),他就是我

ieew commented 2 years ago

我说说我目前的测试环境。 mirai-api-http: 2.5.0 adapter: 0.0.9 nonebot2: 2.0.0b2

fatinghenji commented 2 years ago

nonebot-adapter-mirai2 0.0.6 可能是adapter版本问题,礼问升级命令

ieew commented 2 years ago

pip install nonebot_adapter_mirai2 --upgrade 或者在 pyproject.toml 中指定新版本的版本号

fatinghenji commented 2 years ago

pip install nonebot_adapter_mirai2 --upgrade 或者在 pyproject.toml 中指定新版本的版本号

升级成功了,但是出现了和V0.0.9 “Waiting for application startup”相同的问题

fatinghenji commented 2 years ago

申请您为好友了,麻烦您通过一下