Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to send message using session.send #6

Closed
FuyukiSakura opened this issue Feb 7, 2018 · 1 comment
Closed

No way to send message using session.send #6

FuyukiSakura opened this issue Feb 7, 2018 · 1 comment

Comments

@FuyukiSakura
Copy link

I keep having this error saying

Error: no way to send message: [object Object]
    at D:\home\site\wwwroot\node_modules\botbuilder-linebot-connector\line\LineConnector.js:748:23
    at Array.map (native)
    at LineConnector.send (D:\home\site\wwwroot\node_modules\botbuilder-linebot-connector\line\LineConnector.js:727:18)
    at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\UniversalBot.js:218:31
    at UniversalBot.tryCatch (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\UniversalBot.js:516:13)
    at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\UniversalBot.js:212:23
    at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\UniversalBot.js:536:17
    at D:\home\site\wwwroot\node_modules\async\lib\async.js:52:16
    at replenish (D:\home\site\wwwroot\node_modules\async\lib\async.js:314:29)
    at D:\home\site\wwwroot\node_modules\async\lib\async.js:326:29

Using the sample code provided in readme.

bot.on('conversationUpdate', function (message) {
    // detect event
    switch (message.text) {
        case 'follow':
            break;
        case 'unfollow':
            break;
        case 'join':
            break;
        case 'leave':
            break;
    }
    var isGroup = message.address.conversation.isGroup;
    var txt = isGroup ? "Hello everyone!" : "Hello " + message.from.name;
    var reply = new builder.Message()
        .address(message.address)
        .text(txt);
    bot.send(reply);
    bot.beginDialog(message.address, "hello")
});

bot.dialog("hello", [
    s => {
        builder.Prompts.text(s, "go");
    },
    (s, r) => {
        s.send("oh!" + r.response)
        s.endDialog()
    }
])

The first message Hello <<username>> is replied to my Line account correctly. So I expect that my Line settings are hooked correctly.

FYI, the App is hosted on Azure.

@FuyukiSakura
Copy link
Author

It turns out that it was because I was using Microsoft's template for bot builder where they have configured bot builder for tableStorage
The connector works like charm after removing that line.

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

No branches or pull requests

1 participant