Skip to content

手动解除禁言后报错 #1

Description

@Doulor

麦麦机器人自动禁言某个人过后,如果由真人手动解除禁言,在本该自动解除禁言的时间到过后会在控制台报错
11-22 22:57:03 [message_storage] 存储消息失败 exc_info=True

11-22 22:57:03 [message_storage] 消息:MessageRecv(message_info=BaseMessageInfo(platform='qq', message_id='notice', time=1763823423.1598659, group_info=GroupInfo(platform='qq', group_id='892360818', group_name='群名称'), user_info=None, format_info=None, template_info=None, additional_config=None, sender_info=None, receiver_info=None), message_segment=Seg(type='notify', data={'sub_type': 'lift_ban', 'lifted_user_info': {'platform': 'qq', 'user_id': 905186496, 'user_nickname': '蕾塞.', 'user_cardname': ''}}), raw_message='{"post_type": "notice", "notice_type": "group_ban", "sub_type": "lift_ban", "group_id": 892360818, "user_id": 905186496, "operator_id": null}', chat_stream=<src.chat.message_receive.chat_stream.ChatStream object at 0x7b88030af9b0>, reply=None, processed_plain_text='')

Traceback (most recent call last):

File "/MaiMBot/src/chat/message_receive/storage.py", line 89, in store_message

user_info_dict = message.message_info.user_info.to_dict()  # type: ignore

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'to_dict'

11-22 22:57:03 [所见] 消息处理失败: 'NoneType' object has no attribute 'user_nickname'

Traceback (most recent call last):

File "/MaiMBot/src/chat/heart_flow/heartflow_message_processor.py", line 85, in process_message

logger.info(f"[{mes_name}]{userinfo.user_nickname}:{processed_plain_text}")  # type: ignore

                           ^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'user_nickname'

应该是要为其添加 None 判断

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions