Coder Social home page Coder Social logo

whatsappbot's Introduction

[WIP] WhatsAPI (Based on web.whatsapp)

What is it?

This package is used to provide a python interface for interacting with WhatsAPP Web to send and recieve Whatsapp messages.

Installation

From Source

  • Clone the Repo
  • Use `pip install -r requirements.txt' to install the required packages.

From PyPI

  • Star the repo :)
  • Install from pip

pip install webwhatsapi

You will need to install Gecko Driver separately, if using firefox, which is the default.

Usage:

  • Import library

from webwhatsapi import WhatsAPIDriver

  • Instantiate driver and set username

driver = WhatsAPIDriver("mkhase")

  • If the module is to be used as part of a script, and you need an image of the QR code, run the firstrun method. This saves the QR as username.png in, stored in the same directory after running command.

driver.firstrun()

If not, you can skip the above step, and directly scan the QR with your phone from the opened Firefox Tab.

  • And now, the fun part, sending messages.

driver.send_to_phone_number(phonenumber, message)

  • Viewing unread messages

driver.view_unread()

  • Callback on receiving messages

For scripting, to set a function to be called whenever a message is received, use the create_callback method, and pass as the only argument, a function. The function must accept an argument, which is the received messages as a list.

TODO:

  • Add 'get profile picture' accessor

Use Cases:

  • Auto Reply bot for whatsapp, “I am away from phone”
  • Can use whatsapp on phone and this api at the same time, (unlike the other whatsapp APIs, since this uses web.whatsapp)
  • No need for number registration
  • Hackathons, very easy to setup a whatsapp messaging service.
  • API for custom bot making
  • Whatsapp cloud( A service):- -- User can access and send messages from anywhere without scanning qr anymore, just simple user login and password

Limitation:- Phone has to be ON and connected to the internet

This is the README file for the project.

whatsappbot's People

Contributors

rks2827 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.