whitechi73 / OpenShamrock

A Bot Framework based on Lsposed with OneBot11(停止维护/禁用于违法用途)
https://whitechi73.github.io/OpenShamrock
GNU General Public License v3.0
1.41k stars 186 forks source link

bug: 群组管理员变动事件问题 #258

Closed sckiyo closed 8 months ago

sckiyo commented 8 months ago

描述 Bug

管理员增加:缺少user_id字段 管理员减少:缺少user_id字段;sub_type字段期望是set/unset,得到un_set

pydantic_core._pydantic_core.ValidationError: 1 validation error for GroupAdminNoticeEvent user_id Field required [type=missing, input_value={'adapter': <alicebot.ada...h8Pkmgjza5wKOEiO4zOu1g'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.6/v/missing

pydantic_core._pydantic_core.ValidationError: 2 validation errors for GroupAdminNoticeEvent sub_type Input should be 'set' or 'unset' [type=literal_error, input_value='un_set', input_type=str] For further information visit https://errors.pydantic.dev/2.6/v/literal_error user_id Field required [type=missing, input_value={'adapter': <alicebot.ada...h8Pkmgjza5wKOEiO4zOu1g'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.6/v/missing

直接用websockets库接收事件并打印,是没有user_id,sub_type也是un_set

复现 Bug

import asyncio import websockets

async def listen(): uri = "ws://" async with websockets.connect(uri) as websocket: while True: event = await websocket.recv() print(event)

asyncio.run(listen())

系统信息