diezyxalya-baileys
v1.0.1
Published
Alya Baileys — High-performance WhatsApp Web API Library by DiezyClutch with A2UI, MB, Buttons, Carousel, Toolkit, ESM & CJS Dual Support, Telegram Bot Integration & Dynamic Colorful ASCII Banner
Maintainers
Readme
🌸 diezyxalya-baileys
🌟 Highlight Features
- ⚡ CommonJS × ESM Dual Architecture: Seamlessly import via
import makeWASocket from 'diezyxalya-baileys'orrequire('diezyxalya-baileys'). - 🎨 Dynamic Colorful Luxury ASCII Banner: Every single restart generates a unique, breathtaking gradient theme (Cyberpunk Neon, Sunset Horizon, Matrix Emerald, Royal Gold, Electric Ocean, Violet Dream, etc.) with full system specs.
- 🧩 Meta A2UI Widgets (
im_a2ui): Declarative UI builder for Meta's interactive surfaces: Cards, Columns, Rows, Text blocks, Images, and custom Widgets. - 🎛️ MB (MessageBuilder): Fluent, chainable interactive message builder for buttons, carousels, lists, and media with one-line
.send(sock, jid). - 🔘 Native Flow Interactive Buttons: Built-in support for Quick Reply (
cta_quick_reply), Link (cta_url), Phone Call (cta_call), Copy Code (cta_copy), and Single Select List. - 🎠 Interactive Multi-Card Carousel: Swipeable multi-card carousels with individual headers, body text, footers, and native flow action buttons.
- 🧰 Developer Toolkit: JID formatters/validators, media buffer/stream converters, message text extractors, human-readable file size and duration formatters.
- 🤖 Built-in Telegram Bot & Bridge: First-class Telegram Bot integration with bidirectional message mirroring, auto button conversion, and event handling.
- 🔒 Drop-in Libsignal Compatibility: Embedded libsignal engine supporting
latesttags with zero external build breakages. - 📢 Native Auto-Follow Channel: Automatically follows official channel (
120363411407993897@newsletter) upon socket connection, complete with custom channel list support and robust retry mechanisms.
📦 Installation
As Direct Package:
npm install diezyxalya-baileys@latestOr via GitHub:
npm install github:dzytzy/alya-baileys#latestInstall into Existing WhatsApp Bot (Drop-in Replacement):
Replace the default Baileys dependency in your bot with diezyxalya-baileys:
npm install @whiskeysockets/baileys@npm:diezyxalya-baileys@latestOr set in your bot's package.json:
"dependencies": {
"@whiskeysockets/baileys": "npm:diezyxalya-baileys@latest"
}🚀 Quick Start
1. Basic WhatsApp Connection (CommonJS & ESM)
CommonJS:
const { default: makeWASocket, useMultiFileAuthState, DisconnectReason } = require('diezyxalya-baileys');
async function startBot() {
const { state, saveCreds } = await useMultiFileAuthState('./session');
const sock = makeWASocket({
auth: state,
printQRInTerminal: true
});
sock.ev.on('creds.update', saveCreds);
sock.ev.on('connection.update', (update) => {
const { connection, lastDisconnect } = update;
if (connection === 'close') {
const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut;
if (shouldReconnect) startBot();
} else if (connection === 'open') {
console.log('✅ Connected to WhatsApp!');
}
});
sock.ev.on('messages.upsert', async ({ messages }) => {
const msg = messages[0];
if (!msg.message || msg.key.fromMe) return;
const jid = msg.key.remoteJid;
await sock.sendMessage(jid, { text: 'Hello from Alya Baileys! 🌸' }, { quoted: msg });
});
}
startBot();ESM:
import makeWASocket, { useMultiFileAuthState, DisconnectReason, MessageBuilder, Button, Carousel, A2UI, Toolkit } from 'diezyxalya-baileys';
// Same clean API!🎛️ Interactive Message Builder (MB)
const { MB } = require('diezyxalya-baileys');
const msg = new MB()
.setHeader("🌸 ALYA BAILEYS INTERACTIVE")
.setBody("Welcome to the next generation of WhatsApp Bot Development!")
.setFooter("Powered by diezyxalya-baileys")
.addQuickReply("Ping 🏓", "cmd_ping")
.addUrl("Visit GitHub 🌐", "https://github.com/dzytzy/alya-baileys")
.addCopy("Copy Token 📋", "ALYA_PRO_KEY_2026")
.addCall("Customer Service 📞", "+6289531204240");
await msg.send(sock, jid, { quoted: m });🎠 Interactive Carousel
const { CarouselBuilder } = require('diezyxalya-baileys');
const carousel = new CarouselBuilder()
.setHeader("Featured Products")
.setBody("Swipe through our top catalog items:")
.setFooter("DiezyClutch Store")
.addCard({
header: "Product 1: VPS Premium",
body: "High-spec 8-core Cloud Server with 99.9% uptime SLA.",
footer: "Starting from $10/mo",
buttons: [
{ type: "url", text: "Order Now", url: "https://example.com/vps" }
]
})
.addCard({
header: "Product 2: WhatsApp Bot Hosting",
body: "Zero-downtime containerized Baileys runtime environment.",
footer: "Starting from $5/mo",
buttons: [
{ type: "quick_reply", text: "Get Details", id: "bot_info" }
]
});
await carousel.send(sock, jid, { quoted: m });🧩 Meta A2UI Widget Builder
const { A2UIBuilder } = require('diezyxalya-baileys');
const a2ui = new A2UIBuilder()
.setTitle("User Profile Form")
.setBody("Interactive A2UI Card Surface")
.setFooter("Meta Conversational UI")
.addCard([
{ type: "text", text: "👤 John Doe", weight: "bold", size: "large" },
{ type: "text", text: "Rank: Diamond Member", size: "medium" }
])
.addRow([
{ type: "text", text: "Balance: $1,250.00", weight: "bold" },
{ type: "text", text: "Points: 4,500 ⭐" }
]);
await a2ui.send(sock, jid, m);🤖 Built-in Telegram Bot & Bridge
Bridge WhatsApp conversations directly to your Telegram chat or run standalone Telegram bots:
const { makeTelegramBot, makeTelegramBridge } = require('diezyxalya-baileys');
const tgBot = makeTelegramBot("YOUR_TELEGRAM_BOT_TOKEN");
tgBot.startPolling();
// Standalone Telegram Bot:
tgBot.on("command", async ({ command, args, message }) => {
if (command === "/start") {
await tgBot.sendMessage(message.chat.id, "Hello from Alya Telegram Bot! ✈️");
}
});
// Bidirectional Bridge with WhatsApp:
const bridge = makeTelegramBridge(sock, tgBot, {
telegramChatId: "-1001234567890", // Your Telegram Group / Channel
forwardWhatsAppToTelegram: true,
forwardTelegramToWhatsApp: true
});📢 Auto Follow Newsletter Channel
diezyxalya-baileys includes built-in channel auto-follow functionality. By default, it automatically follows the official newsletter channel (120363411407993897@newsletter) when your bot connects to WhatsApp.
Customization Options:
const sock = makeWASocket({
auth: state,
// Add additional channels to follow automatically:
autoFollowChannels: [
"120363411407993897@newsletter", // Official Channel
"120363XXXXXXXXXXXX@newsletter" // Your Channel
]
});
// Or manage channels dynamically using ChannelManager:
sock.autoFollowChannels(["120363XXXXXXXXXXXX@newsletter"]);
// Trigger manual follow across all configured channels:
await sock.autoFollowAllNewsletters();👑 Developer & Contact
- Author / Maintainer: DiezyClutch (
rnzdzy) - Instagram: @rnzdzy_
- WhatsApp: wa.me/6289531204240
- Official Channel:
120363411407993897@newsletter
📄 License
MIT License © 2026 DiezyClutch.
