    def search(self, keywords=None, **attributes):
        """
        搜索消息记录

        :param keywords: 文本关键词
        :param attributes: 属性键值对
        :return: 所有匹配的消息
        :rtype: :class:`wxpy.Messages`
        """

        def match(msg):
            if not match_text(msg.text, keywords):
                return
            if not match_attributes(msg, **attributes):
                return
            return True

        return Messages(filter(match, self), max_history=self.max_history)
搜索消息记录

:param keywords: 文本关键词
:param attributes: 属性键值对
:return: 所有匹配的消息
:rtype: :class:`wxpy.Messages`
wxpy/api/messages/messages.py