errbot

Stop processing message after match in Errbot


how I can stop processing message after match? For example something like this:

    @re_botcmd(pattern=r"(.*)(damn|fuck|stupid)(.*)$", flags=re.IGNORECASE,matchall=True)
    def be_nice(self, msg, match):
        yield "Could you be more nice (((?"
        stop_processing_msg(msg)

Also is there a way to orginize matching, so it can be done in particular order?


Solution

  • For this specific feature I would use a command filter: http://errbot.io/en/latest/errbot.html#errbot.cmdfilter

    Send a message directly to the user and you have the opportunity here to block the processing.

    As for the order of interpretation, we don't have a complete solution yet but we have: