Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

How to spawn a webbot - to start / go back to a conversation #40

Open
tidjee opened this issue Jun 1, 2018 · 3 comments
Open

How to spawn a webbot - to start / go back to a conversation #40

tidjee opened this issue Jun 1, 2018 · 3 comments

Comments

@tidjee
Copy link

tidjee commented Jun 1, 2018

Hi,
In my conversation, I want to show a webpage to the user, so that he can check items he wants to order. I need to go back to the conversation afterward. When I try to spawn an instance of the bot, I'm having an error in bot.createconversation.

It use " let bot = controller.spawn({}); " which works well with facebook bot but does not seems to be enough for web bot.

I'm having the following error 👍
"info: An error occurred while sending a message: TypeError: Cannot read property 'json' of undefined"

When I look at the code, it's bot.http_response that is undefined.

Here is the code :

goto_checkout: function (controller, message) {
    let bot = controller.spawn({});
    bot.createConversation(message, this.checkout);
},

Many thanks !

@DnsFilth
Copy link

DnsFilth commented Jul 4, 2018

Hi, I'm getting the same error, did you find out how to do it?

@DnsFilth
Copy link

so this function doesn't work?

function sendAlertToBot(alert_message) {
controller.spawn({}, function(bot) {
bot.say(alert_message);
});
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants