

def command(self, command, token, team_id=None, methods=['GET'], **kwargs):
    'A decorator used to register a command.\n        Example::\n\n            @slack.command(\'your_command\', token=\'your_token\',\n                           team_id=\'your_team_id\', methods=[\'POST\'])\n            def your_method(**kwargs):\n                text = kwargs.get(\'text\')\n                return slack.response(text)\n\n        :param command: the command to register\n        :param token: your command token provided by slack\n        :param team_id: optional. your team_id provided by slack.\n                        You can also specify the "TEAM_ID" in app\n                        configuration file for one-team project\n        :param methods: optional. HTTP methods which are accepted to\n                        execute the command\n        :param kwargs: optional. the optional arguments which will be passed\n                       to your register method\n        '
    if (team_id is None):
        team_id = self.team_id
    if (team_id is None):
        raise RuntimeError('TEAM_ID is not found in your configuration!')

    def deco(func):
        self._commands[(team_id, command)] = (func, token, methods, kwargs)
        return func
    return deco

dataset/ETHPy150Open VeryCB/flask-slack/flask_slack/slack.py Slack.command/original