2

I've been programming a bot that can make an appointment for a dental clinic as an example. If the human tries to make an appointment in a day when there is no hours left, the robot asks if he/she would like another day. If the human says something like 'No', I would like to close the bot so it seems like the human or the robot have hanged up. Thank you in advance and if I haven't had explained me correctly ask anything you need.

KamiJuanmi
  • 46
  • 4
  • Can't you just make a category where the bot, says, "Ok, thank you for stopping by. Goodbye"? – Steve Worswick Mar 17 '20 at 08:22
  • Yes, first I thought that. But I was wondering if there is anything like that to force the human start the conversation again (it seems to me the most natural reaction) so I thought that could be closing the bot/window – KamiJuanmi Mar 17 '20 at 13:37

1 Answers1

0
//textLine is the human answer
    if ((textLine == null) || (textLine.length() < 1))
        textLine = MagicStrings.null_input;
    if (textLine.equals("no")) {
        System.exit(0);
    } else {
        String request = textLine;
        if (MagicBooleans.trace_mode)
            System.out.println("STATE=" + request + ":THAT=" + ((History) chatSession.thatHistory.get(0)).get(0) + ":TOPIC=" + chatSession.predicates.get("topic"));
        String response = chatSession.multisentenceRespond(request);
        while (response.contains("&lt;"))
            response = response.replace("&lt;", "<");
        while (response.contains("&gt;"))
            response = response.replace("&gt;", ">");
    }

System.out.println(response); //response is the bot response

this is my code in java if i send "no" the bot quit

ouba
  • 3
  • 3