Whatsapp-bot - Whatsapp chatbot build with python and twilio

Overview

Whatsapp-bot

This is a Whatsapp Chatbot that responds with quotes, reply owners name, search internet for meaning of any word.

Usage

  1. Download and install Python. Version 3 and above should come with pip.

  2. Clone or fork this repository (project).

    $ git clone https://github.com/arinzejustin/whatsapp-bot.git
    
    $ cd whatsapp-bot
    
  3. Create a virtual environment inside this project directoy e.g.,

    python -m venv whatsapp-bot-venv
    

    Then activate that environment:

    Windows: whatsapp-bot-venv\Scripts\activate
    
    Mac: $ source whatsapp-bot-venv/bin/activate
    
  4. Install the following dependencies: twilio, flask, requests, beautifulsoup, wikipedia.

    $ pip install twilio flask requests beautifulsoup4 wikipedia
    
  5. Run the Flask application
    Start by setting (exporting) the FLASK_APP environment variable

    Windows: set FLASK_APP=bot.py
    
    Mac: $ export FLASK_APP=bot.py
    

    Run this command afterwards:

    python -m flask run
    
  6. Test the chatbot.

    a. Download ngrok. From your CLI (terminal or CMD), navigate to the ngrok directory and run this command:

     $ ngrok http -region=eu 5000
    

    Copy the URL where you see Forwarding. It will look like this https://510f-197-211-63-19.eu.ngrok.io.

    ngrok jpg

    b. Create an account on Twilio and navigate to the Whatsapp Sandbox. Follow the instructions from Twilio to get a test whatsapp account. At the end of the setup, paste the url you copied earlier into the input field with the label WHEN A MESSAGE COMES IN. At the end of the URL, add '/chatbot' and hit save.

    See the screenshot below:

    twilio jpg

    Bonus: You can create a customized link for your Whatsapp chatbot. Use this template: http://wa.me/<phone-number-from-twilio>?text=<code-to-join-sandbox>.

    twilio whatsapp number jpg

    Send the link to your friends to try out the chatbot.

Technologies Used

  • Python, Flask framework
  • Twilio
  • ngrok
  • wikipedia
  • beautifulsoup

Contact

Send me an email
Visit my website

License GitHub

See license

You might also like...
Tracker to check the covid shot slot availability in India and send mobile alerts via Twilio Messaging Service.

Cowin-Slot-Tracker Tracker to check the covid vaccine slot availability in India and send mobile notifications through Twilio Messaging Service. Requi

Hellomotoot - PSTN Mastodon Client using Mastodon.py and the Twilio API

Hello MoToot PSTN Mastodon Client using Mastodon.py and the Twilio API. Allows f

This project, search all entities related to A2P in twilio

Mirror A2P Twilio This project, search all entities related to A2P in twilio (phone numbers, messaging services, campaign, A2P brand information and P

Most Powerful Chatbot On Telegram Bot

About Hello, I am Lycia [リュキア], An Intelligent ChatBot. If You Are Feeling Lonely, You can Always Come to me and Chat With Me! How To Host The easiest

A simple Telegram bot that converts a phone number to a direct whatsapp chat link
A simple Telegram bot that converts a phone number to a direct whatsapp chat link

Open in WhatsApp I was using a great app to open a whatsapp chat with a given number directly without saving that number in my contact list, but I fel

This Telegram bot allows you to create direct links with pre-filled text to WhatsApp Chats

WhatsApp API Bot Telegram bot to create direct links with pre-filled text for WhatsApp Chats You can check our bot here. The bot is based on the API p

WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community

WallAlley.bot About WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community. All data a

Python Markov Chain chatbot running on Telegram

Hanasubot Hanasubot (Japanese 話すボット, talking bot) is a Python chatbot running on Telegram. The bot is based on Markov Chains so it can learn your word

Chatbot with python code!

Chatbot Python Chatbot with python! How to Run Installation requirements. pip install -r requirements.txt Sample Chatbot The required files must be d

Owner
arinzejustinng
I’m a self-taught Front End Developer and a little bit backend Developer, an Economics student from Nigeria. I like knowing logic behind any application
arinzejustinng
Python On WhatsApp - Run your python codes on whatsapp along with talking to a chatbot

Python On WhatsApp Run your python codes on whatsapp along with talking to a chatbot This is a small python project to run python on whatsapp. and i c

Prajjwal Pathak 32 Dec 30, 2022
WhatsApp API Python ChatBot

WhatsApp Api Python - Esta documentação tem como objetivo exemplificar o uso do Moorse Whatsapp API na linguagem Python.

Douglas Alves 2 Jan 6, 2022
WhatsApp Api Python - This documentation aims to exemplify the use of Moorse Whatsapp API in Python

WhatsApp API Python ChatBot Este repositório contém uma aplicação que se utiliza

Moorse.io 3 Jan 8, 2022
Coronavirus whatsapp chatbot to give real time info on covid

Covy Developed a coronavirus whatsapp chatbot which gives case counts in a particular district, city, state or country. It also predicts future cases

Devinco (Rachit) 0 Oct 3, 2021
A python tool to Automate Whatsapp through Whatsapp web

This python tool is used to Automate Whatsapp through Whatsapp web. We can add number of contacts whom we want to send text messages on perticular time

null 5 Jul 21, 2022
Ubuntu env build; Nginx build; DB build;

Deploy 介绍 Deploy related scripts bitnami Dependencies Ubuntu openssl envsubst docker v18.06.3 docker-compose init base env upload https://gitlab-runn

Colin(liuji) 10 Dec 1, 2021
A Python module for communicating with the Twilio API and generating TwiML.

twilio-python The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio AP

Twilio 1.6k Jan 5, 2023
A Python module for communicating with the Twilio API and generating TwiML.

twilio-python The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio AP

Twilio 1.6k Jan 5, 2023
Texting service to receive current air quality conditions and maps, powered by AirNow, Twilio, and AWS

The Air Quality Bot is generally available by texting a zip code (and optionally the word "map") to (415) 212-4229. The bot will respond with the late

Alex Laird 8 Oct 16, 2022
The Official Twilio SendGrid Led, Community Driven Python API Library

The default branch name for this repository has been changed to main as of 07/27/2020. This library allows you to quickly and easily use the SendGrid

Twilio SendGrid 1.4k Jan 7, 2023