示例#1
0
def default_event_type_resolver(event):
    """The Hacktoolkit-flavored default event type resolver for Slack webhook events
    """
    (text, command, args,) = parse_event_text(event)
    event_handlers = get_event_handlers(event)
    event_type = command if command in event_handlers else 'default'
    return event_type
示例#2
0
def default_event_type_resolver(event):
    """The Hacktoolkit-flavored default event type resolver for Slack webhook events
    """
    (
        text,
        command,
        args,
    ) = parse_event_text(event)
    event_handlers = get_event_handlers(event)
    event_type = command if command in event_handlers else 'default'
    return event_type
def help(**kwargs):
    event = kwargs.get('event')
    event_handlers = get_event_handlers(event)
    commands = ['`%s`' % command for command in sorted(event_handlers.keys())]
    usage_dict = {
        'description': 'Displays available commands. Available commands are: %s' % ', '.join(commands),
        'basic' : 'htk: command args',
        'examples' : [
            'htk: help help',
        ]
    }
    return usage_dict
示例#4
0
def help(**kwargs):
    event = kwargs.get('event')
    event_handlers = get_event_handlers(event)
    commands = ['`%s`' % command for command in sorted(event_handlers.keys())]
    usage_dict = {
        'description': 'Displays available commands. Available commands are: %s' % ', '.join(commands),
        'basic' : 'htk: command args',
        'examples' : [
            'htk: help help',
        ]
    }
    return usage_dict