Unknow String been prompted
In this example, the bot should only answer "That's correct! The meaning of life is 42" if the user says '42', and it should say "Sorry you couldn't figure it out. Everyone knows that the meaning of life is 42." if the result is something else.
However, if the user tells the bot the answer is "12", the response of the bot is "I didn't understand. What's the meaning of life". Why would the bot say "I didn't understand."? This string isn't in the code, and why he wouldn't print the 'else' message "Sorry you couldn't figure it out. Everyone knows that the meaning of life is 42."?
So the "I didn't understand." part is coming from the validatedPrompt(). The answer of "12" didn't pass the validation so it triggered the default response. You can tweak this message by passing in a retryPrompt when you call the validatedPrompt().
Hello @Stevenic, so if my validate function returns false it will trigger the default response? It sounds a bit odd that Bot Framework would give any response at all, in my opinion it should only throw errors and in this specific case, I don't think it shouldn't do anything because I want to treat the response. But this is just a suggestion.
Anyway, would you mind to give me an example on how to pass retryPrompton validatedPrompt()? Because on my understanding, I should only give as parameters the validate function and the promptType (which is text).
If you want to process the response and generate your own reply, don't use the validatedPrompt(). Just call Prompts.text() and then implement your own logic to validate the users response. The validatedPrompt() is intended to take a fairly boiler plate set of 20 - 30 lines of code and reduce it down to about 3 lines of code. All of the dialog actions are meant to be helpers. You don't have to use them.
Thanks for clarifying things. Now it makes sense.
NP... I'm actually planning to replace validatedPrompt() with a new Custom Prompts system. This new system will let you create prompts that behave more like the built-in ones and give you more control over how re-prompts work & such.