Exemplo n.º 1
0
def create_dialog(config):
    add_command(config['command'], config['description'])

    entry = _fname(config['entrypoint'])
    __dialogs.append((entry, config['command']))
    subscibe(entry, DialogHandler(config['entrypoint']), _run=False)

    for handler in config['handlers']:
        subscibe(_fname(handler), DialogHandler(handler), _run=False)
Exemplo n.º 2
0
def create_dialog(config):
    add_command(config['command'], config['description'])
    entry = config['entrypoint']
    entry.command = config['command']

    disp_conf = {'': entry}

    for handler in config['handlers']:
        disp_conf[_fname(handler)] = handler

    disp = get_dialog_dispatcher(disp_conf)

    subscibe('ybot.telegram.message', disp, _run=False)