That "Gary guy" is Gary Pretty. He made a nice job on QnAMaker
, especially a few days ago by providing access to QnAMaker API v3 through a package, which provides a lot of new features compared to QnAMakerDialog
.
For every user coming to your question and looking for a similar answer, you should definitely have a look to his package:
With his package, you can directly override NoMatchHandler
and you're done.
For those who are reluctant to use a third-party package, even if you have the code, the "official" QnAMakerDialog
comes from Microsoft.Bot.Builder.CognitiveServices
package, which sources are... also on GitHub.
So if you look in QnAMakerDialog.cs
you will see that everything you need is inside MessageReceivedAsync
method, in particular the message is sent by this line:
await context.PostAsync(qnaMakerResults.ServiceCfg.DefaultMessage);
As you can also see:
MessageReceivedAsync
can't be overridden easily
even if you hide this method with new
and copy paste all the method except the line, you will have problems with some properties like serviceCfg
that are internal so can't be used in your own namespace
So the last option will be to copy all the QnA classes from Microsoft Github's project just to remove this line...
EDIT:
As you can see on https://github.com/Microsoft/BotBuilder-CognitiveServices, there are several issues pending around this problem:
I hope there will be an integration in the package soon, as several Pull Request have been provided around that