Your complete documentation for using @trashcore/baileys
Choose the method that best fits your development needs:
Install the latest stable version from npm. Best for production.
"dependencies": {
"@trashcore/baileys": "latest"
}
Install the exact stable version from npm.
"dependencies": {
"@trashcore/baileys": "^4.0.5"
}
Then run:
npm install
Install directly from the official GitHub repo for the latest features (may be unstable).
"dependencies": {
"@trashcore/baileys": "github: Tennor-modz/MD-Baileys"
}
Or install via CLI:
npm install github:Tennor-modz/MD-Baileys
Use your own or a modified fork for custom features or fixes.
"dependencies": {
"@trashcore/baileys": "github:your-username/baileys"
}
Replace your-username with your GitHub handle.
npm install
Get your bot running in minutes with this simple setup:
const {
default: TrashcoreConnect
} = require('@trashcore/baileys');
async function startBot() {
const trashcore = await TrashcoreConnect({
printQRInTerminal: true
});
trashcore.ev.on('messages.upsert', async (m) => {
const msg = m.messages[0];
if (!msg.message) return;
const text = msg.message.conversation;
if (text === 'ping') {
await trashcore.sendMessage(msg.key.remoteJid, { text: 'pong!' });
}
});
// Custom pairing example
const phoneNumber = '+1234567890';
const cleanNumber = phoneNumber.replace(/[^0-9]/g, '');
console.clear();
const custom = "TRASHBOT";
const pairCode = await trashcore.requestPairingCode(cleanNumber, custom);
}
startBot();
Configure the browser environment for optimal performance:
browser: ["Ubuntu", "Opera", "100.0.4815.0"]
Organize your project with this recommended structure:
my-bot/ ├── index.js ├── package.json └── node_modules/
pkg install git
npm install
Secure login with QR code scanning for WhatsApp Web sessions
Alternative login method using phone number pairing
Optimized for speed with minimal resource usage