Skip to content

Commit

Permalink
Add support for multi agents
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel-learningpool committed Aug 15, 2018
1 parent 8d67283 commit 0eaf784
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/botkit-middleware-dialogflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ module.exports = function(config) {
return;
}

// COREHACK - Add it in to support multiple bots
if (config.version === 'V2') {
if (!config.keyFilename.includes(bot.dialogflowKeyFileName)) {
next();
return;
}
} else {
if (bot.dialogflowToken !== config.token) {
next();
return;
}
}
// ENDCOREHACK

for (const pattern of ignoreTypePatterns) {
if (pattern.test(message.type)) {
debug('skipping call to Dialogflow since type matched ', pattern);
Expand Down

0 comments on commit 0eaf784

Please sign in to comment.