Basically what is bot…
In basic terms a bot is a program which runs on behalf of human intervention .which is an effective way to perform a repetitive job
let us see how to build one..
In this article we will see how to build a COVID-19 BOT
REQUIREMENTS:
- Flask a python framework
- python
- Twilio account
- virtual environment
- working whatsapp account
Create an free account in Twilio
configure the twilio account 👇
https://www.youtube.com/watch?v=O2PB6o2E8aA
once you have setup your twilio sanbox now we need to create the virtual env
$ mkdir watsupbot$ cd watsupbot$ virtualenv myvenv$ source myvenv/scripts/activate (for windows)$ pip install flask twilio requests
now create file by name app.py
Now its time time to get our hands dirty :)
import the modules inside app.py
Basic Logic:
To handle the incoming message from the user and to reply them
Api used:
which is a application programming interface from which we are fetching the live data of people who have affected by the COVID-19 virus
https://api.rootnet.in/covid19-in/stats/latest
Watch it live
https://www.youtube.com/watch?v=NL-PxclX1cs&t=35s
look into the github repository for entire code
</HAPPY CODING>