- A some-what bare template for whatsapp chatbot..originally made using twilio sandbox
- original proposal was tailored towards an electronic startup that sells electronic components
- can be extended or changed to suit any business type with minor or major tweaks
-
this is not an AI-ML bot, an example of an AI bot with ML can be found here, ZIMSEC bot
-
This example bot
On development app
, has many sides, here i show 2, how it works for both a client and the moderator -
..seperately with no problem 😎
-
Click this link to whatsapp bot. After that you can type hie or hello or start.
- Well, as much as i try to give out my thoughts to the public,
EXCEPTION HANDLING
is to be done by the interested personnel in this project
- This whatsapp bot makes use of twilio sandbox for prototyping
- Needs twilio credentials, login to your twilio console and replace yr keys in credentials.py
- Can host on heroku free tier and choose automatic deployment from your github master branch
- bulksms service can be used depending on use case, one such service is bulksmszw and ther is a library for that at bulksms zw api library
- or if its hot-recharge services like
TechZim airtime bot
, can integrate it using the hot-recharge zw api library *still testing, raise issues and star for updates.
whether this is a good design structure | not, this worked for me
- you can change depending on your project or business model- in src folder, it handles all the bot functionalities subdivided into different modules to aid in upgrading the bot later
- most bot utilities are implemented inside utils.py
- statistics are in a seperate folder e.g stats
- commands and help texts are in their seperate e.g folder
- clone or fork this repo!
- for cloud serving, you can use heroku free account and choose automatic deploy from your bot github repository
- needs a twilio account and twilio tokens and sandbox ready, check the twilio website
- for local testing, fire up your flask server and run ngrok (needs Ngrok installed)
- you can google on the internet how to do so, there is a tutorial about that
- run some tests, and show off to friends, family and clients 😉
-
after successful deployment to heroku, use your free heroku url to add to twilio console on callback webhook
-
as
https://your-heroku-url/whatsapp
and let magic rain, your bot is automatically now linked between the 2 and is now online 24/7 -
for local testing with ngrok, use
https://your-temporary-ngrok-https-url/whatsapp
on the twilio console. Dont use thehttp
url -
Make bots like what the banks have, like what that whatsapp bot you admired works, be creative 👨🎨
- If you like this sort of bot template helpful give it a STAR 🌟 or FORK 😃 | FOLLOW. It motivates..I might bring an extra open source free project as a head-start next that you might find helpful too 😉