Exemple #1
0
def action_wrapper_user(hermes, intentMessage, conf):
    global Snips
    user = intentMessage.slots.user.first().value
    if (Snips.existUser(user)):
        msg = "Cambio de usuario a " + user
        Snips.changeActiveUsers(user)
        Change_User(user)
    else:
        msg = "El usuario " + user + " no existe"
    hermes.publish_end_session(intentMessage.session_id, msg)
Exemple #2
0
def action_wrapper_AnadirUsuario(hermes, intentMessage, conf):
    global Snips
    user = intentMessage.slots.user.first().value
    if (not Snips.existUser(user)):
        msg = "Añadiendo usuario " + user + ' y cambio a dicho usuario'
        Snips.addUser(user)
        Snips.changeActiveUsers(user)
        Add_User(user)
    else:
        msg = "El usuario " + user + " ya existe"
    hermes.publish_end_session(intentMessage.session_id, msg)