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

Cannot send message #12

Open
deathg0d opened this issue Sep 24, 2017 · 4 comments
Open

Cannot send message #12

deathg0d opened this issue Sep 24, 2017 · 4 comments

Comments

@deathg0d
Copy link

deathg0d commented Sep 24, 2017

Trying to use this demo in my existing project with the latest Botkit. My 'facebook_optin' is working fine. But when I send any other message from facebook I get the following error:

TypeError: Cannot set property 'stage' of undefined at Object.Botkit.botkit.receiveMessage (... CoreBot.js:108:33)

Line 108 in CoreBot.js looks like the following:

botkit.receiveMessage = function(bot, message) {
        message._pipeline.stage = 'receive'; // <------------------- this is line 108
        botkit.middleware.receive.run(bot, message, function(err, bot, message) {
            if (err) {
@davidvexel
Copy link

Same issue here when updating from ^0.5.2 → ^0.6.4 and using interactive buttons.

@deathg0d
Copy link
Author

deathg0d commented Oct 11, 2017

@davidvexel I solved this by using controller.ingest(bot, facebook_message); instead of controller.receiveMessage(bot, message); Remember to use facebook_message and not facebook_message.message. Hope it works for you too.

@davidvexel
Copy link

thanks @deathg0d, I'm using it on Slack, wondering if it's the same work around.

@mvaragnat
Copy link
Owner

Hey folks,

Just to let you know that

  1. I'm not actively maintaining that repo anymore
  2. Since Botkit, Slack API, FB API evolve very quickly, there is a high probability of obsolescence of some parts of the code.

=> If you find a solution to your issue, please consider a PR! I'll happily merge it. This repo is aimed at helping beginners, so let's make it better

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

3 participants