今日已更新 84 条资讯 | 累计 37333 条内容
关于我们

How I Built a WhatsApp AI Bot That Runs for $0/Month on Windows

ZeroCost Tech 2026年08月16日 05:37 4 次阅读 来源:Dev.to

I wanted a simple WhatsApp AI bot without paying every month for cloud hosting or an AI API. So I built one that runs on a Windows PC I already have running 24/7. The result: WhatsApp integration with Node.js Optional local AI using Ollama No VPS or cloud server required No paid AI API required Runs on Windows 10/11 Can restart automatically after a reboot «The "$0/month" refers to additional software, hosting, and AI API costs. It assumes you already have the PC, internet connection, and electricity.» The basic architecture The setup is intentionally simple: WhatsApp → Node.js bot → Local AI → WhatsApp reply The Node.js application handles incoming WhatsApp messages and decides how to respond. For AI responses, the bot can send the user's message to a locally running Ollama model and return the generated answer back to WhatsApp. That gives us: WhatsApp → Node.js → Ollama on localhost → Node.js → WhatsApp No cloud AI API is required. What you need For the basic setup: Windows 10 or Windows 11 Node.js LTS A WhatsApp account Ollama if you want local AI A computer that can stay powered on You don't need Kubernetes. You don't need AWS. You don't need Docker. And you don't need to rent a VPS. Connecting WhatsApp For this project I used "whatsapp-web.js". The first time the application starts, it displays a QR code. You scan the QR code with WhatsApp, similar to connecting WhatsApp Web. After authentication, the application can listen for incoming messages and send replies. A simplified example looks like this: const { Client, LocalAuth } = require('whatsapp-web.js'); const client = new Client({ authStrategy: new LocalAuth() }); client.on('qr', (qr) => { console.log('Scan the QR code to connect WhatsApp'); }); client.on('ready', () => { console.log('WhatsApp bot is ready'); }); client.on('message', async (message) => { if (message.body.toLowerCase() === 'hello') { await message.reply('Hello from the bot!'); } }); client.initialize(); "LocalAuth" stores the authenticated W

本文内容来源于互联网,版权归原作者所有
查看原文