(self, message)
return False
:type message: wechatpy.messages.BaseMessage
:type message: wechatpy.messages.BaseMessage
: type message : wechatpy . messages . BaseMessage
def _match(self, message):
        """
        :type message: wechatpy.messages.BaseMessage
        """
        if self.type == self.Type.ALL:
            return True
        elif self.type == self.Type.MSGTYPE:
            return message.type == self.content["msg_type"]
        elif self.type == self.Type.EVENT:
            return (message.type == self.ReceiveMsgType.EVENT
                and self._event_match(message))
        elif self.type == self.Type.EVENTKEY:
            return (message.type == self.ReceiveMsgType.EVENT
                and self._event_match(message)
                and hasattr(message, "key")
                and message.key == self.content["key"])
        elif self.type == self.Type.CONTAIN:
            return (message.type == self.ReceiveMsgType.TEXT
                and self.content["pattern"] in message.content)
        elif self.type == self.Type.EQUAL:
            return (message.type == self.ReceiveMsgType.TEXT
                and message.content == self.content["pattern"])
        elif self.type == self.Type.REGEX:
            return (message.type == self.ReceiveMsgType.TEXT
                and re.search(self.content["pattern"], message.content))
        return False
def _match ( self , message ) : if self . type == self . Type . ALL : return True elif self . type == self . Type . MSGTYPE : return message . type == self . content [ "msg_type" ] elif self . type == self . Type . EVENT : return ( message . type == self . ReceiveMsgType . EVENT and self . _event_match ( message ) ) elif self . type == self . Type . EVENTKEY : return ( message . type == self . ReceiveMsgType . EVENT and self . _event_match ( message ) and hasattr ( message , "key" ) and message . key == self . content [ "key" ] ) elif self . type == self . Type . CONTAIN : return ( message . type == self . ReceiveMsgType . TEXT and self . content [ "pattern" ] in message . content ) elif self . type == self . Type . EQUAL : return ( message . type == self . ReceiveMsgType . TEXT and message . content == self . content [ "pattern" ] ) elif self . type == self . Type . REGEX : return ( message . type == self . ReceiveMsgType . TEXT and re . search ( self . content [ "pattern" ] , message . content ) ) return False