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

请求适配消息撤回事件 #38

Closed
YangRucheng opened this issue Mar 15, 2023 · 0 comments · Fixed by #39
Closed

请求适配消息撤回事件 #38

YangRucheng opened this issue Mar 15, 2023 · 0 comments · Fixed by #39
Labels
enhancement New feature or request

Comments

@YangRucheng
Copy link

这个事件本身对我没什么用处, 但是无法解析这个事件导致经常报错.
( 或者有什么办法让它忽略这个事件吗

03-15 12:15:09 [WARNING] nonebot | QQ Guild | Failed to parse event Dispatch(opcode=<Opcode.DISPATCH: 0>, data={'message': {'author': {'bot': False, 'id': '537106425******', 'username': '白昼梦游指北'}, 'channel_id': '246******', 'guild_id': '74010238******', 'id': '089890b6fbf3fdedda6610b887db75385b4******'}, 'op_user': {'id': '5371064253******'}}, sequence=2, type='MESSAGE_DELETE', id='MESSAGE_DELETE:9ef1e775-de71-4cc2-8e48-ddf366adb680')
Traceback (most recent call last):
  File "/home/Nonebot/bot.py", line 29, in <module>
    nonebot.run(app="__mp_main__:app")
  File "/usr/local/lib/python3.10/dist-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nonebot/drivers/fastapi.py", line 187, in run
    uvicorn.run(
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/qqguild/adapter.py", line 216, in _forward_ws
    event = self.payload_to_event(payload)
  File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/qqguild/adapter.py", line 303, in payload_to_event
    event = Event.parse_obj(payload.data)
  File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 526, in parse_obj
    return cls(**obj)
TypeError: Can't instantiate abstract class Event with abstract method get_type
03-15 12:15:09 [WARNING] nonebot | QQ Guild | Unknown payload type: PUBLIC_MESSAGE_DELETE
03-15 12:15:09 [WARNING] nonebot | QQ Guild | Failed to parse event Dispatch(opcode=<Opcode.DISPATCH: 0>, data={'message': {'author': {'bot': False, 'id': '5371064253740******', 'username': '白昼梦游指北'}, 'channel_id': '2468******', 'guild_id': '74010238******', 'id': '089890b6fbf3fdedda6610b887db75385b488******'}, 'op_user': {'id': '5371064253******'}}, sequence=3, type='PUBLIC_MESSAGE_DELETE', id='PUBLIC_MESSAGE_DELETE:e92b1aef-995a-472a-9a0c-f83b446b2720')
Traceback (most recent call last):
  File "/home/Nonebot/bot.py", line 29, in <module>
    nonebot.run(app="__mp_main__:app")
  File "/usr/local/lib/python3.10/dist-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nonebot/drivers/fastapi.py", line 187, in run
    uvicorn.run(
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/qqguild/adapter.py", line 216, in _forward_ws
    event = self.payload_to_event(payload)
  File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/qqguild/adapter.py", line 303, in payload_to_event
    event = Event.parse_obj(payload.data)
  File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 526, in parse_obj
    return cls(**obj)
TypeError: Can't instantiate abstract class Event with abstract method get_type

日志中中的ID被我去掉了

谢谢!

@yanyongyu yanyongyu added the enhancement New feature or request label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants