const { default: makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion } = require('@whiskeysockets/baileys');
const qrcode = require('qrcode-terminal');
const fs = require('fs');
async function startBot() {
const { state, saveCreds } = await useMultiFileAuthState('df-store-session');
const { version } = await fetchLatestBaileysVersion();
const sock = makeWASocket({
version,
auth: state,
printQRInTerminal: true,
logger: undefined,
markOnlineOnConnect: true,
});
console.log('🚀 DF Store Bot Starting...');
sock.ev.process(async (events) => {
if (events['connection.update']) {
const { connection, lastDisconnect, qr } = events['connection.update'];
if (qr) qrcode.generate(qr, { small: true });
if (connection === 'open') console.log('✅ DF Store Bot Berhasil Terhubung!');
if (connection === 'close') {
if (lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut) {
startBot();
}
}
}
if (events['messages.upsert']) {
const { messages } = events['messages.upsert'];
const m = messages[0];
if (!m.message) return;
const text = (m.message.conversation || m.message.extendedTextMessage?.text || '').toLowerCase().trim();
const from = m.key.remoteJid;
const isGroup = from.endsWith('@g.us');
// ==================== DF STORE MENU ====================
if (text === '.menu' || text === 'menu') {
const menuText = `╔══════════════════╗
║ 🌟 DF STORE 🌟 ║
╠══════════════════╣
• .ping
• .owner
• .produk
• .harga
• .sticker (reply gambar)
• .toimg (reply sticker)
• .ai (tanya apa saja)
• .tiktok [url]
• .ig [url]
• .order (pesan produk)
• .admin (hubungi admin)
Kirim perintah sesuai kebutuhan! 🔥`;
await sock.sendMessage(from, { text: menuText });
}
if (text === '.ping') await sock.sendMessage(from, { text: '🏓 Pong! DF Store Bot Aktif!' });
if (text === '.owner' || text === '.admin') {
await sock.sendMessage(from, { text: '👑 Owner DF Store\nWA: 628xxxxxxxxxx\nSupport 24 Jam' });
}
if (text === '.produk') {
await sock.sendMessage(from, { text: `📦 Produk DF Store:\n\n1. Pulsa & Data\n2. Diamond Game\n3. Akun Premium\n4. Script Bot\n5. Panel Bot\n\nKetik .order untuk pesan.` });
}
// Simple AI
if (text.startsWith('.ai ')) {
const query = text.slice(4);
await sock.sendMessage(from, { text: `🤖 DF Store AI:\n\n${query}\n\nJawaban: Fitur ini masih dalam pengembangan, tapi pertanyaanmu sangat bagus! Mau saya bantu apa lagi?` });
}
// Sticker
if (text === '.sticker' && m.message.imageMessage) {
const stream = await sock.downloadMediaMessage(m);
await sock.sendMessage(from, { sticker: stream });
}
if (text === '.toimg' && m.message.stickerMessage) {
const stream = await sock.downloadMediaMessage(m);
await sock.sendMessage(from, { image: stream, caption: '✅ Berhasil diubah oleh DF Store' });
}
// Order
if (text === '.order') {
await sock.sendMessage(from, { text: '🛒 Silakan ketik produk yang diinginkan + jumlahnya.\nContoh: order diamond ml 1000' });
}
}
});
sock.ev.on('creds.update', saveCreds);
}
startBot();
const { default: makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion } = require('@whiskeysockets/baileys');
const qrcode = require('qrcode-terminal');
const fs = require('fs');
async function startBot() {
const { state, saveCreds } = await useMultiFileAuthState('df-store-session');
const { version } = await fetchLatestBaileysVersion();
║ 🌟 DF STORE 🌟 ║
╠══════════════════╣
• .ping
• .owner
• .produk
• .harga
• .sticker (reply gambar)
• .toimg (reply sticker)
• .ai (tanya apa saja)
• .tiktok [url]
• .ig [url]
• .order (pesan produk)
• .admin (hubungi admin)
Kirim perintah sesuai kebutuhan! 🔥`;
await sock.sendMessage(from, { text: menuText });
}
}
startBot();