The bot I'm trying to build has a question structure as such:
Would you like to learn about the news, or the weather?
-The weather
For which city would you like to check?
-New york
The aim is for the specified keyword New York, the bot answers with the specific weather url. If you answer "news" and then "new york", it would answer the url that is about news in new york. There are a lot of alternative choices in the bot, so it is difficult to find a solution to seperate the keywords with the same name.
I got you a simple example you can work with.
First we define some kind of structure to hold every answer tree and it's leaves. This is a meaningful format of the context you may use:
Here you got some code to make the main logic of the simple bot logic even clearer: