Skip to content

Simple WhatsApp AI bot. Supports voice messages and video downloads from social networks.

License

Notifications You must be signed in to change notification settings

yaasiin-ayeva/WhatsBot

Repository files navigation

WhatsBot
Static Badge GitHub Repo stars GitHub forks

Preview

Simple WhatsApp bot from unofficial WhatsApp API, built in NodeJS & TypeScript, using Gemini & ChatGPT APIs for completion, with many cool features. You can interact with the bot using voice messages, and it will transcribe and respond. 🤖

Try it here: WhatsBot Playground or scan the QR code below:


WhatsApp QR Code

Features

In development mode, your bot prefix will be automatically set to !. Meanning that you can use !help to get the list of commands instead of /help.

Feature Description Example
Voice Chat Chat with AI and expect a audio/text response from the bot Just send an audio message
AI Completion with Gemini AI Sends a message to the AI /chat [text]
AI Completion with ChatGPT Sends a message to the AI /gpt [text]
Video Download from social media Download file from social media Just send the video link or /get <url>
Memes Get random meme /meme
Jokes Get random joke /joke
Help Get help /help
Ping Ping the bot /ping
Language Translation Translate text to the specified language /translate [language-code] [text]
Weather Get current weather for a city /meteo <city>

Getting Started

I. Running on Docker (Recommended)

  1. From DockerHub image for a Quick Test
docker pull yaasiinayeva/whatsbot:latest
docker run -d -p 3000:3000 yaasiinayeva/whatsbot
  1. From the Github Code
  • After cloning the project make sure to setup your environnment variables from the .env.example file
cp .env.example .env
  • Then Build your container and start your project
docker-compose up --build -d

A QR code will be generated for you to scan. Go to localhost:3000 Kindly scan it with your whatsapp app and you're all set! 🎉

II. Runninng Locally without docker (Not Recommended)

Important

Running locally requires you to do more configuration. This project is based on whatsappweb.js which uses Pupperteer. It requires a brower driver to work. You have to install Chrome or Chromium on your machine. Make sure the environment variables are set in the .env file before starting the server. The PUPPETEER_EXECUTABLE_PATH should be set to your chrome/chromium browser path.

npm install
cp .env.example .env
npm run dev

A QR code will be generated for you to scan. Go to localhost:3000 Kindly scan it with your whatsapp app and you're all set! 🎉

Configurations

You can change the configurations in src/configs/app.config.ts

For third-party services used in the bot, kindly get the API keys and set them correctly. These are the one used in the bot, skipping them could lead to limitations :

Disclaimer

Warning

It is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, especially when it is used to spam people. So this shouldn't be considered totally safe.

TODO

  • (WIP) Refactor the code to not use btch-downloader anymore and build a custom downloader to make it compatible with axios rather than got. Kindly check dl-mate
  • Implement a queue system to handle multiple concurrent video download requests at the same time and make the bot more responsive
  • Refactor the code to not use third-party services for speech-to-text and use whisper-node instead
  • Add support for more social media platforms
  • Add support for any kind of file download
  • i18n support
  • Add support for more translation languages
  • Implement an API for the bot
  • Add more features (Open to suggestions)

Contributing

If you'd like to contribute, please read the Contributing Guide

License

MIT

About

Simple WhatsApp AI bot. Supports voice messages and video downloads from social networks.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages