You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be useful to let onDispatch signal that it has handled the utterance.
The simplest thing would be to return true if the utterance was handled. But handling the utterance is probably the default. It would be ideal if you only had to write extra code if you didn't handle the utterance.
So maybe return false if you didn't handle it? Anything else, including no return, would be considered "handled".
Then the following has new meaning (and value):
if(awaitthis.onDispatchToChild()){// no child, or it didn't handle it}
Question: would it ever be useful to distinguish between the two cases? Actually we know if we have a child, so that's easy to figure out.
The text was updated successfully, but these errors were encountered:
I struggled with this in botbuilder-dialogs as well and ultimately landed on just using context.responded to determine if something was handled. It's a bit indirect as we're assuming the fact you sent a reply means you handled it but if you did send a reply its probably safe to say you handled the utterance and what's nice is you didn't need to remember to return something.
You can argue that a case exists where I handled the utterance and intentionally chose not to reply but that seems really rare and if you wanted to do that you could explicitly set context.responded = true; to ensure no fallback code runs.
I think I'm going to go the other way. I'm taking context.responded at face value, and I do indeed want to handle cases where the activity is handled without a response.
It might be useful to let
onDispatch
signal that it has handled the utterance.The simplest thing would be to return
true
if the utterance was handled. But handling the utterance is probably the default. It would be ideal if you only had to write extra code if you didn't handle the utterance.So maybe return
false
if you didn't handle it? Anything else, including no return, would be considered "handled".Then the following has new meaning (and value):
Question: would it ever be useful to distinguish between the two cases? Actually we know if we have a child, so that's easy to figure out.
The text was updated successfully, but these errors were encountered: