does the web chat iframe support multiple messages in a response?
I embedded the iframe into a custom site for testing and when I call the bot framework nodejs API:
session.send("my message");
followed by:
builder.Prompts.text(session, 'Please enter y/n');
On the emulator locally, I get the follow-up prompt, but the web chat iframe doesnt even send the second message. Also, this occurs on Slack as well... Is that just a limitation of the iframe application/slack channel that was built?
It's likely your AppId or AppSecret aren't properly setup. Can you share your bots setup code?
Which code are you after exactly? The iframe code, or the nodejs bot setup?
The NodeJS code please.
I'll try to show you as best as I can, Im just going to remove some of my private code as best I can.
Note, I have removed the application id and subscription key from the code below, I can provide these to you privately if need be?
var restify = require('restify');
var builder = require('botbuilder');
var gd = require("./dialogs/greeting-dialog.js");
var model = 'https://api.projectoxford.ai/luis/v1/application?id=MY_APP_ID&subscription-key=SUB_KEY';
var dialog = new builder.LuisDialog(model);
var myBot = new builder.BotConnectorBot();
var server = restify.createServer();
myBot.add('/', dialog);
gd.welcomeDialog(dialog);
dialog.onDefault(builder.DialogAction.send("I'm sorry I didn't understand."));
// Serve a static web page
server.get(/.*/, restify.serveStatic({
'directory': '.',
'default': 'index.html'
}));
server.post('/api/messages', myBot.listen());
server.listen(process.env.port || 8080, function () {
console.log('%s listening to %s', server.name, server.url);
});
The code : gd.welcomeDialog(dialog); is where I enact the multiple inputs as I mentioned is the original post.
On the line below you should provide your bots AppId & AppSecret:
var myBot = new builder.BotConnectorBot();
And on the line below you should probably include a call to myBot.verifyBotFramework().
server.post('/api/messages', myBot.listen());
It's not required but helps make your bot more secure. You can leave it out until you get everything else working.
Hey Stevenic, are you saying that this is the cause of the issue with the iframe/slack channel? Or is this just best practice?
The first issue is likely why your bot isn't working with the WebChat control. The second is a best practice.
Sorry Stevenic, I implemented your suggestions and it simply doesnt seem to respond with multiple responses... but still works fine in the emulator
Closing this issue. @xmark - please open a new issue if this issue is not fixed and needs further discussion. @Stevenic - reopen if necessary. Thanks!