Giter Site home page Giter Site logo

facebook-bot-messenger's People

Contributors

junkaiii avatar mastasky avatar mohelm97 avatar mschipperheyn avatar piranit avatar snlangsuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

facebook-bot-messenger's Issues

cannot return a message from a user

probably something simple i'm doing wrong as i had it appear once(only once and i made no major changes afterwards which is strange).

i'm trying to get the text from the users message but the message object in bot.on(MessengerPlatform.Events.MESSAGE, function(userId, message)

returns:
TextMessageEvent { getType: [Function], setType: [Function], getPageId: [Function], getTime: [Function], getUserId: [Function], getSenderId: [Function], getRecipientId: [Function], getTimestamp: [Function], toJSON: [Function], toString: [Function], isTextMessage: [Function], isQuickReply: [Function], hasAttachments: [Function], getMessageSeq: [Function], getMessageId: [Function], getText: [Function] }

however using bot.getProfile(userId).then(function(data) and then echoing the message produces

{"sender":{"id":"XXXXXXXXXXXXXX"},"recipient":{"id":"XXXXXXXXXXXXXX"},"timestamp":1514505450956,"message":{"mid":"mid.XXXXXXXXXXXXXXXXXXXXXXX","seq":XXXX,"text":"hello"}}

any ideas on where i might be going wrong? sorry for the noob question im quite new to javascript/nodejs

what is pageID and validation token

validationToken: ''
appID: '',

what is validation token.
Is appId = facebook app id in developer console or bot agent id in dialogflow console.

Support for handover protocol.

Would you consider providing support for handover protocol?

I'd be happy to contribute some work:

  • Support of messaging_handovers and standby webhooks
  • Introduce helper methods for

When using handover protocol, we need to subscribe to the messaging_handovers and standby webhooks.

Currently the package only supports the messaging webhook:

I can contribute with a PR that helps accept the two types of webhooks and also provide the related helper methods:

  • Passing Thread Control
  • Taking Thread Control
  • Requesting Thread Control
  • Enabling Live Chat via the Page Inbox

npm package unpublished?

Unfortunately your package was not findable on npm. Published it again with v. 1.0.9.

Was this an accident or on purpose?

List Template is not working.

I tested with your sample code. And it is not working.

var element1 = new MessengerPlatform.ListElementTemplateBuilder('Classic Black T-Shirt', 'https://peterssendreceiveapp.ngrok.io/img/black-t-shirt.png', '100% Cotton, 200% Comfortable');
element1.setDefaultAction('https://peterssendreceiveapp.ngrok.io/view?item=102', 'https://peterssendreceiveapp.ngrok.io/', true, URLButton.HEIGHT_RATIO.TALL)
        .addURLButton('Buy', 'https://peterssendreceiveapp.ngrok.io/view?item=102');

var element2 = new MessengerPlatform.ListElementTemplateBuilder('Classic Gray T-Shirt', 'https://peterssendreceiveapp.ngrok.io/img/gray-t-shirt.png', '100% Cotton, 200% Comfortable');
element2.setDefaultAction('https://peterssendreceiveapp.ngrok.io/view?item=103', 'https://peterssendreceiveapp.ngrok.io/', true, URLButton.HEIGHT_RATIO.TALL)
        .addURLButton('Buy', 'https://peterssendreceiveapp.ngrok.io/shop?item=103');
var template = new MessengerPlatform.ListTemplateBuilder();
template.isLargeTopElement(true)
        .addElement(element1)
        .addElement(element2)
        .addPostbackButton('View More', 'USER_DEFINED_PAYLOAD');
var builder = new MessengerPlatform.AttachmentMessageBuilder(template);
bot.sendMessage(userId, builder) 

It showed "URLButton is not defined"
So, i changed "URLButton.HEIGHT_RATIO.TALL" to "tall". And, it still not working.

Error: Can't render headers after they are sent to the client

Hi,

I am encountering this error, i followed the documentation on how to use it with Express but still get this error. Am i missing something? I am using the latest package version

Error: Can't render headers after they are sent to the client
at ServerResponse.writeHead (_http_server.js:214:15)
at BotMessenger.handleGETRequest (path\node_modules\facebook-bot-messenger\li
b\botmessenger.js:160:21)
at Server.httpRequest (path\node_modules\facebook-bot-messenger\lib\botmessen
ger.js:42:22)
at emitTwo (events.js:130:20)
at Server.emit (events.js:213:7)
at parserOnIncoming (_http_server.js:602:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)

Can't render headers after they are sent to the client

It seems there is an error in botmessenger.js line 161.
After writeHead, the headers are baked in and you can only call res.write(data), and finally res.end(data).

Since you don't include a return after line 159, the writeHead function is called again after the response is completed, leading to the Can't render headers after they are sent to the client error.

Sending Template Builder

Hi Guys, wonderful node module, I have one problem, I cannot for teh life of me work out how to send a template, I can get it built, but cannot figure out how to send it

I have tried passing the builder construct into all the bot.sendxxx and cannot see a senbd for templates ..

I know its probably obvious, but HELP!!
Many thanks

MArk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.