whatsapp_bot.mdx 1.1 KB

123456789101112131415161718192021222324252627
  1. ---
  2. title: '💬 WhatsApp Bot'
  3. ---
  4. ### 🖼️ Template Setup
  5. - Fork [this](https://replit.com/@taranjeetio/EC-WhatsApp-Bot-Template?v=1#README.md) replit template.
  6. - Set your `OPENAI_API_KEY` in Secrets.
  7. - Register for a free account on [Twilio](https://www.twilio.com/try-twilio) and create a new Whatsapp Sandbox.
  8. - You can find it in the left Sidebar under `Develop` by navigating to `Messaging>Try it out>Send a WhatsApp Message`.
  9. - To connect a phone number and allow it to chat with the bot, follow the on screen instructions.
  10. - Click on `Run` in the replit container and a URL will get generated for your bot.
  11. - Copy the URL, append `/chat` at the end and paste it under `When a message comes in` under the `Sandbox settings` for Whatsapp in Twilio. Save your settings.
  12. ### 🚀 Usage Instructions
  13. - To allow a new number or reconnect an old number with the Sandbox, follow the instructions in your Twilio account.
  14. - To add data sources to the bot, use the command:
  15. ```text
  16. add <data_type> <url_or_text>
  17. ```
  18. - To ask queries from the bot, use the command:
  19. ```text
  20. <question>
  21. ```
  22. 🎉 Happy Chatting! 🎉