How to use the opsdroid.helper.add_skill_attributes function in opsdroid

To help you get started, we’ve selected a few opsdroid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opsdroid / opsdroid / opsdroid / constraints.py View on Github external
def constraint_decorator(func):
        """Add user constraint to skill."""

        def constraint_callback(message, users=users):
            """Check if the user is correct."""
            return message.user in users

        func = add_skill_attributes(func)
        if invert:
            constraint_callback = invert_wrapper(constraint_callback)
        func.constraints.append(constraint_callback)
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for crontab matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"crontab": crontab, "timezone": timezone})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for luisai matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"luisai_intent": intent})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for witai matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"witai_intent": intent})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for Dialogflow matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"dialogflow_intent": intent})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for Dialogflow matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"dialogflow_action": action})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for Rasa NLU matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"rasanlu_intent": intent})
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for parse matching."""
        func = add_skill_attributes(func)
        func.matchers.append(
            {
                "parse_format": {
                    "expression": format_str,
                    "case_sensitive": case_sensitive,
                    "matching_condition": matching_condition,
                    "score_factor": score_factor or REGEX_PARSE_SCORE_FACTOR,
                }
            }
        )
        return func
github opsdroid / opsdroid / opsdroid / constraints.py View on Github external
def constraint_decorator(func):
        """Add connectors constraint to skill."""

        def constraint_callback(message, connectors=connectors):
            """Check if the connectors is correct."""
            return message.connector and (message.connector.name in connectors)

        func = add_skill_attributes(func)
        if invert:
            constraint_callback = invert_wrapper(constraint_callback)
        func.constraints.append(constraint_callback)
        return func
github opsdroid / opsdroid / opsdroid / matchers.py View on Github external
def matcher(func):
        """Add decorated function to skills list for SAPCAI matching."""
        func = add_skill_attributes(func)
        func.matchers.append({"sapcai_intent": intent})
        return func