devalexanderdaza / yowsapp-framework

Yowsaapp Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yowsapp Framework


WARNING

It seems that recently yowsup gets detected during registration resulting in an instant ban for your number right after registering with the code you receive by sms/voice. I'd strongly recommend to not attempt registration through yowsup until I look further into this. Follow the status of this here.

Yowsapp 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.

Yowsapp 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

**NOTE: I highly recommend making use of the library in a completely clean linux environment. My recommendation would be to use a Digital Ocean VPS here: https://m.do.co/c/ec1e4f467265 **

This needs Python >= 2.7 and <=3.7

Setup:

  1. Clone this repository (with submodules since it uses tgalal's yowsup3 library)
> git clone https://github.com/devalexanderdaza/yowsapp-framework.git
  1. Run yowsapp_installer.sh (Most likely on sudo since its going to install some libraries)
> sudo ./yowsapp_installer.sh
  1. Register your phone and get a password with like this: The process of registering the telephone line will be done within the execution of the file yowsapp_installer.sh
  2. Save the login JSON response, rename config_example.py to config.py
> mv config_example.py config.py
  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:

About

Yowsaapp Framework


Languages

Language:Python 98.9%Language:Shell 1.1%