Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/efishery/nemo

Customize Whatsapp ChatBot without code
https://github.com/efishery/nemo

efishery hacktoberfest whatsapp whatsapp-bot whatsapp-chat whatsapp-session

Last synced: about 1 month ago
JSON representation

Customize Whatsapp ChatBot without code

Awesome Lists containing this project

README

        



# NeMo Whataspp ChatBot

Customizeable Whatsapp chatbot with simply creating a YML file to configure the bot, very easy to configure.

Why you need this ? imagine you want to automate your shop order or catalog your shop, or just simply don't want to reply some annoying friend

The tools is awesome it just the documentation that looks shitty, help me to fix the documentation :(

This tools is the study case research from the eFishery to solve problem "How might we gather data supply from farmer it self" so we create a bot whatsapp because farmer is very familiar with whatsapp and facebook rather than with new apps



# Showcase

[NeMo as the WhatsApp Shop Online Assistant](https://github.com/k1m0ch1/BoBoT/tree/master/bot)

# How it work
You need to test the NeMo is connected with your device and then you create the YAML file as the Bot Configuration and then test the bot by triggering the bot from the keyword registered at configuration, the configuration is called coral, you can learn about the coral configuration in here [Understanding Coral Configuration](https://nemo-efishery.readthedocs.io/en/latest/#understanding-basic-coral-configuration)

NeMo is using the reverse engineered whatsapp web from here [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng), this is the only reason why the requirement need the screen is stay awake and focus on whatsapp application, we are using [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) for the golang library

Nemo is also using the randomizer pause chat depends on how many word is typed, its like how typical human type the word 1-3 secon perword, also NeMo will sent the "typing" mode so the whatsapp will thinking that we are as the person



# Requirements
1. android phone connected to pc/laptop
2. the android phone need to enable the settings "Stay awake" (screen will never sleep while charging), "USB Debugging", "Install via USB"

you need to enable this so you can connect your device with your pc/laptop

3. the screen stay on whatsapp appplication

you need to do this so the nemo will not interupted, because the nemo is using the `web.whatsapp.com` API so the device need to be always connected to internet

# How to run

to run you need to have enviroment variable as in `.env.example`, rename it to `.env`, by default you need to create `coral` dir or you can specify by env var `CORAL_DIR`. The `coral` dir is for the bot configuration written in YAML format, to create a `coral` directory and put all the coral file in this folder, also you need the WhatsApp session file in order to connect to the current phone

Use this tools to generate the whatsapp session file [k1m0ch1/WhatsappLogin](https://github.com/k1m0ch1/WhatsappLogin), you can download the latest binary file from [the latest release](https://github.com/k1m0ch1/WhatsappLogin/releases/)

and run with command `./WhatsappLogin -p 08123123123` and scan the QR

after you have file `08123123123.gob` and `coral` directory with `basic.yml` inside, run the NeMo with this command

```
./NeMo 08123123123
```

this will find the file `08123123123.gob` in the `SESSION_DIR` environment variable by default this will goes to current directory running file

# Run on Development

Use the makefile and run this on command `make run p=`

# Run With Docker

you must prepare the `coral` directory include with yaml file and Whatsapp file session, after that mount volume in docker with example command like this

```
docker run \
--name NeMo -v $(pwd)/coral:/app/coral \
-v $(pwd)/.sessions/08123123123.gob:/app/08123123123.gob \
k1m0ch1/nemo 08123123123

```

The configuration is called coral, you can learn about the coral configuration in here [Understanding Coral Configuration](https://nemo-efishery.readthedocs.io/en/latest/#understanding-basic-coral-configuration)

## To Do

[] need to validate if the ChatBot already sent the message, so he will not sent a duplicate message

[] weird file session JSON error parsing, weirdly added the `"":"}` string in the end

[] build for ANY expected users, along with the builder

[] if error logging in, try to re-login

[] YAM file can be `.yaml` or `.yml`, currently only `yml` is validated

## Done List

[] ~~Multi Schedule is not~~

[] ~~Multi file yml with some with no greeting or no schedule or no commands~~

[] ~~must test all the builder work well~~

[] ~ada orang yang nyangkut gara gara status NEXT nya diem, bisanya nge break pas ada ~

[] ~~semua bentuk dokumen harus di kasih handler~~

[] ~~ada orang yg kirim gambar langsung tanpa command atau session apapun, langsung ngebreak soalnya dia mencoba coral yg tidak exist~~

[] ~~kirim gambar langsung modar~~

[] ~~ga ada sesinya langsung modar, masalah di image handler~~