Search code examples
chatbotfacebook-messenger-bot

How to use a database with a messenger chat bot to store responses of users?


I'm building a chat bot and I want to connect it to a database to store user response to a question, I deploy the app to heroku, how can I use mysql to do that job and if there is a good resource please recommend


Solution

  • You can use the ClearDB or Jaws DB MySQL add-ons, then just make the DB calls in your webhook code, probably indexing on psid:

    https://devcenter.heroku.com/articles/jawsdb

    https://devcenter.heroku.com/articles/cleardb