⚑ Real-time Gemini-powered WhatsApp replies

Turn your WhatsApp into a Hinglish AI buddy 😎

This bot sits on top of WhatsApp Web and auto-replies like an extroverted friend – powered by Google’s Gemini API. Whitelist your close contacts, keep your vibe, and let AI handle β€œkya scene hai?” all day long.

Runs locally on your laptop
No chat data stored on a server
😎
RK online
WhatsApp + Gemini Bot

Bro, sutta marne chalega? 🚬

5:41 PM

Chal na bhai 😎 main toh ready hi baitha hu. Kidhar milna hai? πŸ˜‰

5:41 PM βœ“βœ“

Tu bot hai ya asli? πŸ‘€

5:42 PM

Secret AI dost hu bro 🀫 Hinglish only, tension free replies 24x7 πŸ˜‚

5:42 PM βœ“βœ“

Powered by Gemini Β· Running locally on Node.js

Why this bot is actually useful πŸ‘‡

Real Hinglish replies

Replies feel like a real friend texting β€” casual, witty, and emoji-aware.

Runs on your machine

No cloud server storing your chats. Everything runs locally using WhatsApp Web automation.

Whitelist + filters

You decide who the bot answers and it ignores tiny β€œok”, β€œhmm” type spam messages.

How it works under the hood 🧠

  1. 1

    whatsapp-web.js launches a controlled Chrome instance and logs into WhatsApp Web using QR code.

  2. 2

    The bot listens for message events and filters by your whitelist.

  3. 3

    Incoming text goes to Gemini via the official @google/genai SDK.

  4. 4

    The model returns a Hinglish reply, the bot fakes typing, then sends it back into the chat with a small random delay.

Tech stack

Node.js whatsapp-web.js @google/genai Puppeteer

Built to be fully local, hackable and easy to extend β€” add personalities, commands, logging or more models with minimal changes.

Install & run locally in a few commands πŸ’»

1. Clone & install

git clone https://github.com/thelivingsofa/whatsapp-gemini.git
cd whatsapp-gemini
npm install
          

2. Create your config

cd src
cp config.example.json config.json
          

3. Fill your details

{
  "apiKey": "YOUR_GEMINI_API_KEY",
  "allowedContacts": ["919123456789"],
  "ignoreShort": true
}
          

4. Run the bot

npm start
          

What you’ll see

  • QR code in the terminal for WhatsApp Web login
  • Chromium window labelled β€œcontrolled by automated software”
  • Console logs like πŸ“© 919123456789: "kya kar raha bro?"
  • Bot replying back with Hinglish messages from Gemini
whatsapp-gemini/
β”‚
└─ src/
   β”œβ”€ bot.js
   β”œβ”€ config.json         ← your API key (🚫 do NOT commit)
   β”œβ”€ config.example.json ← template (βœ” commit)
β”‚
β”œβ”€ .gitignore
β”œβ”€ package.json
β”œβ”€ README.md
              
⚠ Use on your own account only. This is an experimental project built for fun & learning. Don’t use it for spam or anything shady.

Core bot logic (simplified) 🧾

// MAIN LOGIC β€” only incoming messages
client.on('message', async (msg) => {
  if (msg.fromMe) return;

  const from = msg.from;
  const text = msg.body.trim();
  const contact = await msg.getContact();
  const number = contact.number;

  // Whitelist by phone number
  if (!config.allowedContacts.includes(number)) return;

  if (config.ignoreShort && text.length <= 2) return;

  const chat = await msg.getChat();
  await chat.sendStateTyping();

  const reply = await generateReply(text);

  // Fix status/broadcast to real chat JID if needed
  let target = from;
  if (!target.endsWith("@c.us")) {
    const userId = contact.id._serialized;
    if (userId.endsWith("@c.us")) target = userId;
  }

  await client.sendMessage(target, reply);
});

Full source code is available on GitHub β€” this is just the important part that wires WhatsApp to Gemini.