I am using ms bot framework and created a new bot. and deployed the bot connector part on the google firebase functions. But below code does not respond. Below is the code:
const builder = require('botbuilder');
const teams = require('botbuilder-teams');
import * as util from 'util';
const restify = require('restify');
let connector = new teams.TeamsChatConnector({
appId: 'my app id',
appPassword: 'my app secret'
});
var server = restify.createServer();
server.listen(80, function () {
console.log('%s listening to %s', server.name, util.inspect(server.address()));
});
server.post('/api/messages', connector.listen());
new builder.UniversalBot(connector, function (session:any) {
console.log("inside bot got something dude:::::" + session.message.text);
});
the end point in bot settings is configured as:
https://us-central1-xxxx.cloudfunctions.net/api/messages
Expected Behavior: when i send a message to the bot using bot tester then i should be able to see console message "inside bot got something dude:::::" in the firebase functions log.
however, it is never invoked so i am not sure what is missing here.
If you are wondering why we are using google firebase functions rather azure then the answer is we use firebase DB and our bot response need to go into the same firedb. Also we dont have to pay/subscribe for one more cloud just to run a simple node base code.