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)
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)