1
votes

I have a QnA bot that should work for a couple of intents and I want to trigger it for None intent, Greeting because I have some unique responses, and IT help because that's the main purpose of the QnA bot. Do I have to copy paste my entire dialog and just change the intent name or can I list multiple intents for the matches method?

  bot.dialog('QnABotRequest', function (session, args) {
       //Code
    }).triggerAction({
        matches: 'Greeting' | 'None' | 'IT Help' //Maybe something like this ?
    });

https://docs.botframework.com/en-us/node/builder/chat-reference/modules/_botbuilder_d_.html#matchtype Where this is defined it says:

{(RegExp|string)[]}

An array of either regular expressions or named intents can be passed to match the users utterance in a number of possible ways. The rule generating the highest score (best match) will be used for scoring purposes.

2

2 Answers

3
votes

The way to use it is:

.triggerAction({
    matches: [/greeting/i, /none/i, /^it help/i]
 )}

or

.triggerAction({ matches: [
    /(roll|role|throw|shoot).*(dice|die|dye|bones)/i,
    /new game/i
 ]});
0
votes

If you are using azure, then you can try the following

bot.dialog('QnABotRequest', function (session, args) {
       //Code
    }).triggerAction({
        matches: ['Greeting', 'None', 'IT Help'],
    })