Skip to content

Commit

Permalink
Fix: gchats response url
Browse files Browse the repository at this point in the history
  • Loading branch information
patrinhani-ciandt committed Oct 9, 2017
1 parent 618daa6 commit 70606c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/controllers/gchats/botkit/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var Botkit = require('@abbott-platform/botkit/lib/CoreBot');
const Botkit = require('@abbott-platform/botkit/lib/CoreBot');
const URL = require('url');

function AbbottBot(configuration) {
// Create a core botkit bot
Expand Down Expand Up @@ -70,9 +71,12 @@ function AbbottBot(configuration) {

var payload = req.body;

let response_url = URL.parse(decodeURIComponent(req.query.response_url));
let responseRoom = payload.conversation.name;

let bot = botkit_core.spawn({
botFirendlyName: botkit_core.config.botFirendlyName,
response_url: req.query.response_url,
response_url: `https://dynamite.sandbox.googleapis.com/v1/${responseRoom}/webhooks${response_url.search}`,
response: res
});
// Receive messages and trigger events from the Events API
Expand Down Expand Up @@ -107,4 +111,4 @@ function AbbottBot(configuration) {
return botkit_core;
}

module.exports = AbbottBot;
module.exports = AbbottBot;

0 comments on commit 70606c4

Please sign in to comment.