MCPcopy Index your code
hub / github.com/Zain-ul-din/whatsapp-ai-bot

github.com/Zain-ul-din/whatsapp-ai-bot @Version3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release Version3.0 ↗ · + Follow
60 symbols 103 edges 19 files 0 documented · 0% updated 5mo agoVersion3.0 · 2024-11-22★ 2494 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

WhatsApp AI Bot 🚀

The WhatsApp AI Bot is a chatbot that uses AI models APIs to generate responses to user input. The bot supports several AI models, including Gemini, ChatGPT, DALL-E, Flux, and Stability AI.

Table of Content

Supported Models

Model Provider Type Command
ChatGPT OpenAI Text to Text !chatgpt
Gemini Google Text to Text !gemini
Gemini Vision Google Image to Text none
Dalle 2 & 3 OpenAI Text to Image !dalle
Flux Hugging Face Text to Image !flux
Stability AI Stability AI Text to Image !stability
Custom Base Provider Text to Text !wa
# Demo

Gemini

Click to see the demo

Screenshot (1186)

Stability AI + Chat-GPT

Click to see the demo

image

Dalle + Custom Model

Click to see the demo

image


Usage

1. Download Source Code

 git clone https://github.com/Zain-ul-din/WhatsApp-Ai-bot.git
 cd WhatsApp-Ai-bot

OR

2. Get API Keys

3. Add API Keys

Copy the file .env.example and rename it to .env, then set any settings you want to change.

4. Run the code

  • Run npm run start to run the bot.

  • Scan QR code.

Default Settings

  • !gemini use gemini.
  • !chatgpt use chat-gpt.
  • !dalle use Dalle.
  • !flux use flux.
  • !stability use stability.

Note! open src/whatsapp-ai.config.ts to edit config.

Docs Link

Tutorials

FQA

Disclaimer

This bot utilizes baileys to operate an actual instance of Whatsapp Web to prevent blocking. However, it is essential to note that these operations come at a cost charged by OpenAI and Stability AI for every request made. Please be aware that WhatsApp does not support bots or unofficial clients on its platform, so using this method is not entirely secure and could lead to getting blocked.

Contributors

Sponsors

A big thank you to these people for supporting this project.

Levitco Anas Ashfaq
Levitco Anas Ashfaq YOU?

Useful links

♥ Sponsor 💎 Bounty 🚀 Deployment ✉ WhatsApp Group
Link Link Link Link

About Us

This repository is maintained by Zain-Ul-Din

Show some ❤️ by starring this awesome repository!

Buy Me A Coffee

Extension points exported contracts — how you extend this code

IModelConfig (Interface)
(no doc)
src/types/Config.d.ts
EnvInterface (Interface)
(no doc)
src/baileys/env.ts
BotImageResponse (Interface)
(no doc)
src/models/OpenAIModel.ts
MessageTemplate (Interface)
(no doc)
src/util/MessageTemplates.ts
IModelType (Interface)
(no doc)
src/types/Config.d.ts
AuthDocument (Interface)
(no doc)
src/baileys/database/mongo.ts
AIArguments (Interface)
(no doc)
src/models/BaseAiModel.ts
IDefaultConfig (Interface)
(no doc)
src/types/Config.d.ts

Core symbols most depended-on inside this repo

sendMessage
called by 6
src/models/FluxModel.ts
handleMessage
called by 2
src/baileys/handlers/message.ts
generateCompletion
called by 2
src/models/GeminiModel.ts
connectToDatabase
called by 1
src/baileys/index.ts
connectToWhatsApp
called by 1
src/baileys/index.ts
configEnv
called by 1
src/baileys/env.ts
connectToMongoDB
called by 1
src/baileys/database/mongo.ts
handlerMessageFromMe
called by 1
src/baileys/handlers/message.ts

Shape

Method 23
Function 16
Class 13
Interface 8

Languages

TypeScript100%

Modules by API surface

src/models/BaseAiModel.ts9 symbols
src/models/GeminiModel.ts8 symbols
src/models/OpenAIModel.ts7 symbols
src/models/CustomModel.ts6 symbols
src/util/Util.ts5 symbols
src/models/StabilityModel.ts5 symbols
src/models/FluxModel.ts5 symbols
src/types/Config.d.ts3 symbols
src/util/MessageTemplates.ts2 symbols
src/baileys/index.ts2 symbols
src/baileys/handlers/message.ts2 symbols
src/baileys/env.ts2 symbols

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add whatsapp-ai-bot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page