GithubHelp home page GithubHelp logo

whatsapp-framework-fork's Introduction

Warning

Whatsapp blocks numbers now. Framework wont work properly until next version

Meanwhile heres a better alternative: project sulla

mac (Whatsapp framework)

Version Version

Mac is a whatsapp bot/framework I made as a weekend project. The project itself has all you need to make your own custom bot easily.

Mac has built-in human behavior so you only have to worry about the functions you make. Every module works completely separated from the core, this means that you can erease every module and mac will keep working

This needs Python 3.5

Setup:

  1. Clone this repository (with submodules since it uses tgalal's yowsup library)
> git clone https://github.com/danielcardeenas/whatsapp-framework.git
  1. Run setup.sh (Most likely on sudo since its going to install some libraries)
> sudo ./setup.sh
  1. Register your phone and get a password with like this:
# Replace CC with your country code (See https://countrycode.org)
> yowsup-cli registration --requestcode sms --phone CCXXXXXXXX --cc CC -E android
# After getting the sms code (in this example: 123456)
> yowsup-cli registration --register 123456 --phone CCXXXXXXXX --cc CC -E android
  1. Open config.py and add set your credentials

  2. Ready to go! (Now you can add your own whatsapp modules)

> ./start.sh

Quickstart

Create your own module inside modules/ directory

# modules/hi_module.py

from app.mac import mac, signals

@signals.message_received.connect
def handle(message):
    if message.text == "hi":
        mac.send_message("Hello", message.conversation)
        
        # Can also send media
        #mac.send_image("path/to/image.png", message.conversation)
        #mac.send_video("path/to/video.mp4", message.conversation)

Now you should only add it into modules/__init__.py to enable the module

# modules/__init__.py
...
from modules import hi_module
...

And that's it! You are ready to go.

If your module needs libraries from pip you should add them into a requirements.txt and run sudo ./setup.sh to download the dependencies
You can take hihelp module as an example.

Updates

The project is not submoduling yowsup now due to a lot of the modifications made are focused for this project only and to make things simpler.

  • Notification on messages receipt (received and blue check marks)
  • Get contacts statuses
  • Get contacts profile picture (also from groups)
  • Set profile picture (also from groups)
  • Send videos (needs ffmpeg installed)
  • Add support for @tag messages
  • Add support for reply messages
  • Add support for receiving images
  • Add support for big receiving big files (downloading and decryption done in chunks)
  • Add support for sending images
  • Add support for encrypting images in chunks (TODO)
  • Add pickle support to remember the messages when mac its turned off(TODO)

Example screenshots:

Wiki

Read this

whatsapp-framework-fork's People

Contributors

danielcardeenas avatar marabesi avatar labtronicsdesign avatar nk521 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.