kinni / fb-bot-framework

Bot Framework for Facebook Messenger Platform.
46 stars 16 forks source link

Session Management? #11

Closed norrisboat closed 6 years ago

norrisboat commented 6 years ago

Was wondering how session management is handled with this library.

kinni commented 6 years ago

this is a bit tricky. You need to use to use some cache tools to help e.g. https://www.npmjs.com/package/memory-cache; or redis.

However you need to implement that part; you need to (re)store the session object when there is a incoming webhook request from Facebook Messenger; then trigger the onMessage event handler with that session object.

I would put up some demo code when I have time. But no ETA yet, if anyone wants to help, please feel free to submit a PR. Thanks.

norrisboat commented 6 years ago

Ok thanks