简体   繁体   中英

Problem with onturnasync of middleware in bot framework v4

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 (ie 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 (ie 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM