(self, starts_with=None, regex=None)
simple message matching to check for commands or general message structures,
        could lead to a crash because of the regex...
simple message matching to check for commands or general message structures,
        could lead to a crash because of the regex...
simple message matching to check for commands or general message structures could lead to a crash because of the regex ...
def check_message_match(self, starts_with=None, regex=None):
        """
        simple message matching to check for commands or general message structures,
        could lead to a crash because of the regex...
        """
        match = False
        if 'msg' in self.meta and self.meta['msg'] is not None and type(self.meta['msg']) in (str, unicode):
            if starts_with is not None:
                if self.meta['msg'].startswith(starts_with):
                    match = True
                else:
                    return False
            if regex is not None:
                if match:
                    match = True
                else:
                    return False
            return match
def check_message_match ( self , starts_with = None , regex = None ) : match = False if 'msg' in self . meta and self . meta [ 'msg' ] is not None and type ( self . meta [ 'msg' ] ) in ( str , unicode ) : if starts_with is not None : if self . meta [ 'msg' ] . startswith ( starts_with ) : match = True else : return False if regex is not None : if match : match = True else : return False return match