I am facing problem with OnTurnAsync()
method of middleware. I have almost integrated Middleware Bot sample of human handoff provided by tompanna in my existing Bot but still OnTurnAsync()
method in Middleware has not being called on message activity.
Ideally Middleware OnTurnAsync()
need to be executed first and then the bot OnTurnAsync()
. In our case bot OnTurnAsync()
is called on every message activity. Can any one having idea about it?
I assume you're talking about this sample, just to be clear.
I haven't looked into it in great detail, but conceptually, the idea behind this is that it will only "handoff" when the certain condition is met (i.e. if the message from the user contains the word "human"). Only in this case will the bot actually "process" the message (by passing it on to a human operator). In all other cases, it assumes that your bot itself is meant to handle the message (i.e. the Turn). Essentially, the sample is helping your bot to "escalate" certain messages to a human operator, not every message. Are you trying to do something different in your bot? Is -every- message supposed to go to the human operator?