Tian-que / nonebot-adapter-kaiheila

Kaiheila adapter for nonebot2
MIT License
27 stars 10 forks source link

v0.3.0版本的bug:Failed to parse event #47

Closed HOursH closed 2 months ago

HOursH commented 6 months ago

报错信息: 12-27 15:02:30 [ERROR] nonebot | Kaiheila | Failed to parse event. Raw: {'s': 0, 'd': {'channel_type': 'GROUP', 'type': 9, 'target_id': '9218059895897538', 'author_id': '3900775823', 'content': '如果上帝为 (met)854640351(met) 关上了一扇门,那么上帝就会让他进入频道 ', 'extra': {'type': 9, 'guild_id': '1248137577650244', 'guild_type': '0', 'channel_name': '南通圣地', 'mention': ['854640351'], 'mention_all': False, 'code': '', 'author': {'id': '3900775823', 'username': '系统通知', 'identify_num': '0001', 'online': True, 'os': 'Websocket', 'status': 1, 'avatar': 'https://img.kookapp.cn/avatars/2022-01/3fK6azE9inHV6TUl.png?x-oss-process=style/icon', 'vip_avatar': 'https://img.kookapp.cn/avatars/2022-01/3fK6azE9inHV6TUl.png?x-oss-process=style/icon', 'banner': '', 'nickname': '系统通知', 'roles': [], 'is_vip': False, 'vip_amp': False, 'bot': False, 'nameplate': [], 'decorations_id_map': None, 'tag_info': {'color': '#7ACC35', 'bg_color': '#7ACC3533', 'text': 'KOOK'}, 'system': True, 'is_sys': True}, 'nav_channels': [], 'msg_icon': 'arrow_right', 'from_type': 0, 'kmarkdown': {'raw_content': '如果上帝为 @rabbitdit 关上了一扇门,那么上帝就会让他进入频道', 'mention_part': [{'id': '854640351', 'username': 'rabbitdit', 'full_name': 'rabbitdit#9834', 'avatar': 'https://img.kookapp.cn/avatars/2023-12/MJxVIJxPiN03o03o.jpg?x-oss-process=style?x-oss-process=style/icon'}], 'mention_role_part': [], 'channel_part': [], 'item_part': []}, 'last_msg_content': '系统通知:如果上帝为 @rabbitdit 关上了一扇门,那么上帝就会让他进入频道', 'send_msg_device': 1, 'content': '如果上帝为 (met)854640351(met) 关上了一扇门,那么上帝就会让他进入频道 '}, 'msg_id': '4aa507fd-0c2d-449f-a129-beb1d2b955dd', 'msg_timestamp': 1703660550607, 'nonce': '', 'from_type': 0, 'self_id': '2360657376', 'group_id': '9218059895897538', 'time': 1703660550607, 'user_id': '3900775823', 'post_type': 'message', 'sub_type': 'kmarkdown', 'message_type': 'group', 'event': {'type': 9, 'guild_id': '1248137577650244', 'guild_type': '0', 'channel_name': '南通圣地', 'mention': ['854640351'], 'mention_all': False, 'code': '', 'author': {'id': '3900775823', 'username': '系统通知', 'identify_num': '0001', 'online': True, 'os': 'Websocket', 'status': 1, 'avatar': 'https://img.kookapp.cn/avatars/2022-01/3fK6azE9inHV6TUl.png?x-oss-process=style/icon', 'vip_avatar': 'https://img.kookapp.cn/avatars/2022-01/3fK6azE9inHV6TUl.png?x-oss-process=style/icon', 'banner': '', 'nickname': '系统通知', 'roles': [], 'is_vip': False, 'vip_amp': False, 'bot': False, 'nameplate': [], 'decorations_id_map': None, 'tag_info': {'color': '#7ACC35', 'bg_color': '#7ACC3533', 'text': 'KOOK'}, 'system': True, 'is_sys': True}, 'nav_channels': [], 'msg_icon': 'arrow_right', 'from_type': 0, 'kmarkdown': {'raw_content': '如果上帝为 @rabbitdit 关上了一扇门,那么上帝就会让他进入频道', 'mention_part': [{'id': '854640351', 'username': 'rabbitdit', 'full_name': 'rabbitdit#9834', 'avatar': 'https://img.kookapp.cn/avatars/2023-12/MJxVIJxPiN03o03o.jpg?x-oss-process=style?x-oss-process=style/icon'}], 'mention_role_part': [], 'channel_part': [], 'item_part': []}, 'last_msg_content': '系统通知:如果上帝为 @rabbitdit 关上了一扇门,那么上帝就会让他进入频道', 'send_msg_device': 1, 'content': '如果上帝为 (met)854640351(met) 关上了一扇门,那么上帝就会让他进入频道 '}, 'message_id': '4aa507fd-0c2d-449f-a129-beb1d2b955dd'}, 'extra': {'verifyToken': 'WyOb1fmZ9wuUNOae', 'encryptKey': '', 'callbackUrl': ''}, 'sn': 45} Traceback (most recent call last): File "/bot/alioth/bot_3.py", line 800, in nonebot.run() File "/usr/local/lib/python3.10/dist-packages/nonebot/init.py", line 331, in run get_driver().run(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/nonebot/drivers/none.py", line 56, in run loop.run_until_complete(self._serve()) File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/kaiheila/adapter.py", line 260, in _forward_ws event = self.json_to_event(json_data, bot and bot.self_id)

File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/kaiheila/adapter.py", line 448, in json_to_event event = Event.parse_obj(json_data) File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj return cls(**obj) File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init raise validation_error pydantic.error_wrappers.ValidationError: 9 validation errors for Event post_type field required (type=value_error.missing) channel_type field required (type=value_error.missing) type field required (type=value_error.missing) target_id field required (type=value_error.missing) content field required (type=value_error.missing) msg_id field required (type=value_error.missing) msg_timestamp field required (type=value_error.missing) nonce field required (type=value_error.missing) user_id field required (type=value_error.missing)

虽然不影响使用,但是看着难受