Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
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
Ejemplo n.º 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