/** * Scraper & Automation Client: Nafzzx Tools (WA Channel Reaction, Polling Vote & AM Gen) * Author / Watermark: Vamz Spectre (VamxAPI) * * Download Raw: * curl -sL "https://code.vamxapi.my.id/snippet/raw/nafzzx-tools" -o nafzzx-tools.js * * Cara Penggunaan CLI: * • Auto Vote: * node nafzzx-tools.js vote "https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y/1" "Pilihan 1" * * • Auto Reaction Pesan Channel: * node nafzzx-tools.js react "https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y/1" "🔥" * * • Auto Daftar Akun Baru: * node nafzzx-tools.js register * * • AM Premium Generator: * node nafzzx-tools.js amgen */ const BASE_URL = 'https://nafzzxdevv.surnxuesk.biz.id'; class NafzzxTools { /** * Otomatis membuat username & password acak yang valid */ static generateRandomCredentials() { const randStr = Math.random().toString(36).substring(2, 9); const randNum = Math.floor(100 + Math.random() * 900); return { username: `vamz_${randStr}_${randNum}`.toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20), password: `pass_${Math.random().toString(36).substring(2, 12)}` }; } /** * Mendaftar akun baru secara otomatis */ static async register(username, password) { const creds = (username && password) ? { username, password } : this.generateRandomCredentials(); const res = await fetch(`${BASE_URL}/auth/register`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }, body: JSON.stringify(creds) }); const data = await res.json().catch(() => ({})); if (!res.ok || !data.logged_in) { throw new Error(data.message || 'Gagal mendaftar akun di Nafzzx Tools'); } return { username: data.username, apiKey: data.api_key, limit: data.limit, baseUrl: data.base_url }; } /** * Login ke akun yang sudah ada */ static async login(username, password) { const res = await fetch(`${BASE_URL}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }, body: JSON.stringify({ username, password }) }); const data = await res.json().catch(() => ({})); if (!res.ok || !data.logged_in) { throw new Error(data.message || 'Gagal login ke Nafzzx Tools'); } return { username: data.username, apiKey: data.api_key, limit: data.limit, baseUrl: data.base_url }; } /** * Dapatkan API Key valid (auto register akun jika belum ada apiKey) */ static async ensureApiKey(apiKey) { if (apiKey) return { apiKey, account: null }; const account = await this.register(); return { apiKey: account.apiKey, account }; } /** * Mengirim Vote ke Polling Channel WhatsApp * @param {string} url - Link polling WhatsApp (contoh: https://whatsapp.com/channel/.../123) * @param {string} option - Opsi jawaban yang dipilih persis seperti di polling * @param {string} [customApiKey] - Opsional, jika kosong akan auto-register akun baru */ static async vote(url, option, customApiKey = null) { if (!url || !option) { throw new Error('Parameter url dan option wajib diisi!'); } const auth = await this.ensureApiKey(customApiKey); const params = new URLSearchParams({ key: auth.apiKey, url: url.trim(), pesan: option.trim() }); const res = await fetch(`${BASE_URL}/api/vote/?${params.toString()}`, { headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } }); const data = await res.json().catch(() => ({})); return { status: data.status === true, action: 'channel_polling_vote', message: data.message || (data.status ? 'Vote berhasil dikirim' : 'Gagal mengirim vote'), data: { target_url: url, selected_option: option, limit: data.limit || (auth.account ? auth.account.limit : null) }, account: auth.account ? { username: auth.account.username, apiKey: auth.account.apiKey } : undefined }; } /** * Mengirim Reaction Emoji ke Pesan Channel WhatsApp * @param {string} url - Link pesan WhatsApp (contoh: https://whatsapp.com/channel/.../123) * @param {string} emoji - Emoji reaksi (contoh: 👍, 🔥, ❤️) * @param {string} [customApiKey] - Opsional, jika kosong akan auto-register akun baru */ static async react(url, emoji, customApiKey = null) { if (!url || !emoji) { throw new Error('Parameter url dan emoji wajib diisi!'); } const auth = await this.ensureApiKey(customApiKey); const params = new URLSearchParams({ key: auth.apiKey, url: url.trim(), reaction: emoji.trim() }); const res = await fetch(`${BASE_URL}/api/rch?${params.toString()}`, { headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } }); const data = await res.json().catch(() => ({})); return { status: data.status === true, action: 'channel_message_reaction', message: data.message || (data.status ? 'Reaction berhasil dikirim' : 'Gagal mengirim reaction'), data: { target_url: url, reaction_emoji: emoji, limit: data.limit || (auth.account ? auth.account.limit : null) }, account: auth.account ? { username: auth.account.username, apiKey: auth.account.apiKey } : undefined }; } /** * Generate Akun Alight Motion Premium */ static async amGen(customOrderId = 'NafzzxOrder-VamzSpectre', customApiKey = null) { const auth = await this.ensureApiKey(customApiKey); const res = await fetch(`${BASE_URL}/api/am/generate`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }, body: JSON.stringify({ key: auth.apiKey, customOrderId: customOrderId.trim() }) }); const data = await res.json().catch(() => ({})); return { status: data.success === true, action: 'am_account_generate', message: data.message || (data.success ? 'Berhasil generate akun AM' : 'Gagal generate akun AM'), data: { email: data.email || null, inboxLink: data.inboxLink || null, customOrderId, limit: data.limit || (auth.account ? auth.account.limit : null) }, account: auth.account ? { username: auth.account.username, apiKey: auth.account.apiKey } : undefined }; } } module.exports = NafzzxTools; // CLI Runner if (require.main === module) { (async () => { const args = process.argv.slice(2); const command = (args[0] || 'help').toLowerCase(); try { let result; if (command === 'vote') { const url = args[1] || 'https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y/1'; const option = args[2] || 'Opsi 1'; result = await NafzzxTools.vote(url, option); } else if (command === 'react' || command === 'reaction') { const url = args[1] || 'https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y/1'; const emoji = args[2] || '🔥'; result = await NafzzxTools.react(url, emoji); } else if (command === 'register' || command === 'daftar') { const res = await NafzzxTools.register(); result = { status: true, action: 'auto_register', message: 'Berhasil mendaftar akun baru otomatis', data: res }; } else if (command === 'amgen') { result = await NafzzxTools.amGen(); } else if (command.startsWith('http')) { // Shortcut: jika langsung memasukkan URL sebagai argumen pertama const url = args[0]; const optionOrEmoji = args[1] || '🔥'; // Jika argumen kedua adalah emoji pendek -> react, jika teks -> vote if (optionOrEmoji.length <= 4 && /\p{Emoji}/u.test(optionOrEmoji)) { result = await NafzzxTools.react(url, optionOrEmoji); } else { result = await NafzzxTools.vote(url, optionOrEmoji); } } else { // Default: uji koneksi dan auto register const acc = await NafzzxTools.register(); const testVote = await NafzzxTools.vote('https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y/1', 'Pilihan A', acc.apiKey); result = { status: true, service: 'Nafzzx Tools Automation', creator: 'Vamz Spectre', account: acc, test_execution: testVote }; } console.log(JSON.stringify({ status: true, creator: 'Vamz Spectre', result }, null, 2)); } catch (err) { console.error(JSON.stringify({ status: false, creator: 'Vamz Spectre', error: err.message }, null, 2)); process.exit(1); } })(); }