whatsamigos
v1.0.0
Published
WhatsApp bot framework with interactive messages, buttons, polls, and more - built on whaileys
Downloads
111
Maintainers
Readme
Whaily - WhatsApp Test Bot
A comprehensive WhatsApp test bot built with the whaileys library. This bot demonstrates various WhatsApp message types, interactive features, and API capabilities.
🚀 Quick Start
# Install dependencies
npm install
# Start the bot
npm startScan the QR code with your WhatsApp app to connect.
📋 Available Commands
Send any of these commands to test different WhatsApp features:
📌 Basic Commands
| Command | Description |
|---------|-------------|
| !help | Show all available commands |
| !ping | Simple text message response |
| !reply | Reply to your message |
| !mention | Mention you in a message |
🖼️ Media Commands
| Command | Description |
|---------|-------------|
| !image | Send an image message |
| !video | Send a video message |
| !audio | Send an audio message |
| !document | Send a PDF document |
| !sticker | Send a sticker |
📍 Location & Contact
| Command | Description |
|---------|-------------|
| !location | Send a location message |
| !contact | Send a contact card |
🔘 Interactive Messages
| Command | Description |
|---------|-------------|
| !buttons | Button message (NativeFlow) |
| !list | List message with sections |
| !template | Template with URL, call, copy buttons |
| !poll | Create a poll |
🎯 Button Types
| Command | Description |
|---------|-------------|
| !urlbtn | URL button - opens a website |
| !callbtn | Call button - makes a phone call |
| !copybtn | Copy button - copies text to clipboard |
| !replybtn | Quick reply buttons |
| !selectbtn | Single select list |
| !carousel | Carousel (experimental) |
📦 Advanced Features
| Command | Description |
|---------|-------------|
| !album | Album message (multiple images) |
| !event | Event/calendar message |
| !product | Product catalog showcase |
| !payment | Payment request message |
⚙️ Other Features
| Command | Description |
|---------|-------------|
| !react | React to a message |
| !presence | Show typing indicator |
| !profile | Fetch profile picture |
| !delete | Message deletion test |
| !disappear | Disappearing message |
🧪 Test Suite
| Command | Description |
|---------|-------------|
| !testall | Run all 23 tests sequentially |
📂 Project Structure
whaily/
├── src/
│ ├── index.js # Main entry point
│ ├── custom-auth-state.js # Authentication handler
│ └── commands/
│ ├── index.js # Command exports
│ ├── basic.js # !ping, !reply, !mention
│ ├── media.js # !image, !video, !audio, !document, !sticker
│ ├── location-contact.js # !location, !contact
│ ├── interactive.js # !buttons, !list, !template, !poll
│ ├── features.js # !react, !presence, !profile, !delete, !disappear
│ ├── help.js # !help
│ ├── testall.js # !testall
│ └── buttons/ # Button type commands
│ ├── index.js # Re-exports all button modules
│ ├── url.js # !urlbtn
│ ├── call.js # !callbtn
│ ├── copy.js # !copybtn
│ ├── reply.js # !replybtn
│ ├── select.js # !selectbtn
│ ├── carousel.js # !carousel
│ ├── album.js # !album
│ ├── event.js # !event
│ ├── product.js # !product
│ └── payment.js # !payment
├── auth_info_whaileys/ # Session data (gitignored)
└── package.json🔧 Configuration
The bot uses these default settings in src/index.js:
{
printQRInTerminal: true,
browser: ['Whaileys Fixed Bot', 'Chrome', '1.0.0'],
syncFullHistory: false,
markOnlineOnConnect: false,
connectTimeoutMs: 60000,
keepAliveIntervalMs: 10000,
qrTimeout: 40000
}📊 Test Results Summary
When you run !testall, you'll get a summary like:
📊 Test Results Summary
✅ Text Message
✅ Reply Message
✅ Mention Message
✅ Image Message
✅ Video Message
✅ Audio Message
✅ Document Message
✅ Sticker Message
✅ Location Message
✅ Contact Message
✅ Button Message
✅ List Message
✅ Template Buttons
✅ Poll Message
✅ Reaction
✅ Presence Update
✅ Profile Picture
✅ Message Deletion
✅ Disappearing Messages
✅ Album Message
✅ Event Message
✅ Product Message
✅ Payment Request
✅ Passed: 23
❌ Failed: 0
📝 Total: 23⚠️ Known Limitations
Some features work differently with whaileys compared to other forks:
| Feature | Status | Notes | |---------|--------|-------| | Native Product Messages | ⚠️ | Falls back to image + buttons | | Native Payment Requests | ⚠️ | Falls back to interactive buttons | | Album Messages | ⚠️ | Falls back to individual images | | Event Messages | ⚠️ | Falls back to text format | | Carousel | ❌ | Requires WhatsApp Business API | | Fetch User Status | ❌ | API unreliable in whaileys |
🔗 Based on Whaileys
This bot uses the whaileys library - a stable fork of Baileys focused on simplicity and reliability.
Installing Whaileys
npm i whaileys📝 Adding New Commands
- Create a new file in
src/commands/orsrc/commands/buttons/ - Export your function
- Add to the appropriate
index.js - Add the command route in
src/index.js - Update
help.jswith the new command
Example:
// src/commands/buttons/mybutton.js
async function testMyButton(sock, jid) {
await sock.sendMessage(jid, {
interactiveMessage: {
body: { text: 'My custom button' },
nativeFlowMessage: {
buttons: [
{
name: 'quick_reply',
buttonParamsJson: JSON.stringify({
display_text: 'Click Me',
id: 'my_btn'
})
}
]
}
}
});
}
module.exports = { testMyButton };🐛 Troubleshooting
Connection Issues
- Delete
auth_info_whaileys/folder and restart - Check internet connection
- Ensure WhatsApp is not logged out on phone
QR Code Not Showing
- Ensure terminal supports QR rendering
- Check
printQRInTerminal: truein config
Commands Not Working
- Check case sensitivity (commands are case-insensitive)
- Ensure bot connection is stable (
✅ Connected to WhatsApp!)
📄 License
MIT License
Made with ❤️ using whaileys
