Help & Tutorials
Info & Panduan
Tutorial lengkap integrasi ke bot, error codes, dan referensi
โ€”
Status
โ€”
Total API
โ€”
Keys
โ€”
Uptime
Tutorial Integrasi Bot
๐ŸŒ Semua
โœˆ๏ธ Telegram
๐Ÿ’ฌ WhatsApp
๐ŸŽฎ Discord
โŒจ๏ธ cURL / HTTP
โœˆ๏ธ
Telegram Bot (Node.js)
Integrasi dengan node-telegram-bot-api
โ–พ
1
Install dependencies
Jalankan di terminal project kamu:
bash
npm install node-telegram-bot-api axios
2
Buat file bot.js
Ganti BOT_TOKEN dengan token dari @BotFather dan ZEXXO_KEY dengan API key kamu.
javascript
const TelegramBot = require('node-telegram-bot-api'); const axios = require('axios'); const fs = require('fs'); const BOT_TOKEN = 'YOUR_BOT_TOKEN_HERE'; const ZEXXO_KEY = 'zxxo_xxxxxxxxxxxxxxxx'; const BASE_URL = 'http://68.183.17.236:3000/api'; const bot = new TelegramBot(BOT_TOKEN, { polling: true }); // Command: /ytmp4 https://youtu.be/xxx bot.onText(/\/ytmp4 (.+)/, async (msg, match) => { const chatId = msg.chat.id; const url = match[1].trim(); bot.sendMessage(chatId, 'โณ Memproses video...'); try { const res = await axios.get(`${BASE_URL}/download/ytmp4`, { params: { url, resolution: '720' }, headers: { 'X-Api-Key': ZEXXO_KEY }, responseType: 'stream' }); const path = `./tmp_${Date.now()}.mp4`; res.data.pipe(fs.createWriteStream(path)); res.data.on('end', async () => { await bot.sendVideo(chatId, path, { caption: 'โœ… Video siap!' }); fs.unlinkSync(path); }); } catch (e) { bot.sendMessage(chatId, `โŒ Error: ${e.message}`); } }); // Command: /ytmp3 https://youtu.be/xxx bot.onText(/\/ytmp3 (.+)/, async (msg, match) => { const chatId = msg.chat.id; bot.sendMessage(chatId, '๐ŸŽต Mengunduh audio...'); try { const res = await axios.get(`${BASE_URL}/download/ytmp3`, { params: { url: match[1].trim() }, headers: { 'X-Api-Key': ZEXXO_KEY }, responseType: 'stream' }); const path = `./tmp_${Date.now()}.mp3`; res.data.pipe(fs.createWriteStream(path)); res.data.on('end', async () => { await bot.sendAudio(chatId, path); fs.unlinkSync(path); }); } catch (e) { bot.sendMessage(chatId, `โŒ Error: ${e.message}`); } }); console.log('๐Ÿค– Bot running!');
๐Ÿ’ก Jalankan dengan node bot.js. Gunakan PM2 agar bot tetap online: pm2 start bot.js
๐Ÿ’ฌ
WhatsApp Bot (Baileys)
Integrasi dengan @whiskeysockets/baileys
โ–พ
โš ๏ธ Baileys adalah library tidak resmi. Gunakan dengan bijak dan hindari spam untuk menghindari banned.
bash
npm install @whiskeysockets/baileys axios
javascript
const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys'); const axios = require('axios'); const ZEXXO_KEY = 'zxxo_xxxxxxxxxxxxxxxx'; const BASE_URL = 'http://68.183.17.236:3000/api'; async function startBot() { const { state, saveCreds } = await useMultiFileAuthState('auth'); const sock = makeWASocket({ auth: state }); sock.ev.on('creds.update', saveCreds); sock.ev.on('messages.upsert', async ({ messages }) => { const msg = messages[0]; if (!msg.message || msg.key.fromMe) return; const jid = msg.key.remoteJid; const text = msg.message.conversation || msg.message.extendedTextMessage?.text || ''; // Command: .ytmp4 [url] if (text.startsWith('.ytmp4 ')) { const url = text.slice(7).trim(); await sock.sendMessage(jid, { text: 'โณ Downloading video...' }); try { const res = await axios.get(`${BASE_URL}/download/ytmp4`, { params: { url, resolution: '480' }, headers: { 'X-Api-Key': ZEXXO_KEY }, responseType: 'arraybuffer' }); await sock.sendMessage(jid, { video: Buffer.from(res.data), caption: 'โœ… Video dari Zexxo API' }); } catch (e) { await sock.sendMessage(jid, { text: `โŒ ${e.message}` }); } } }); } startBot();
๐ŸŽฎ
Discord Bot (discord.js)
Integrasi dengan discord.js v14 slash commands
โ–พ
bash
npm install discord.js axios
javascript
const { Client, GatewayIntentBits, SlashCommandBuilder } = require('discord.js'); const axios = require('axios'); const ZEXXO_KEY = 'zxxo_xxxxxxxxxxxxxxxx'; const BASE_URL = 'http://68.183.17.236:3000/api'; const BOT_TOKEN = 'YOUR_DISCORD_BOT_TOKEN'; const client = new Client({ intents: [GatewayIntentBits.Guilds] }); client.on('ready', () => { console.log(`โœ… Logged in as ${client.user.tag}`); }); client.on('interactionCreate', async (interaction) => { if (!interaction.isChatInputCommand()) return; if (interaction.commandName === 'ytmp4') { const url = interaction.options.getString('url'); await interaction.deferReply(); try { const res = await axios.get(`${BASE_URL}/download/ytmp4`, { params: { url, resolution: '480' }, headers: { 'X-Api-Key': ZEXXO_KEY }, responseType: 'arraybuffer' }); await interaction.editReply({ content: 'โœ… Download selesai!', files: [{ attachment: Buffer.from(res.data), name: 'video.mp4' }] }); } catch (e) { await interaction.editReply(`โŒ Error: ${e.message}`); } } }); client.login(BOT_TOKEN);
โŒจ๏ธ
cURL / HTTP Langsung
Untuk testing, scripting, atau integrasi apapun
โ–พ
curl examples
# Download MP4 video curl "http://68.183.17.236:3000/api/download/ytmp4\ ?url=https://youtu.be/xxx&resolution=720" \ -H "X-Api-Key: zxxo_xxx" \ -o video.mp4 # Download MP3 audio curl "http://68.183.17.236:3000/api/download/ytmp3\ ?url=https://youtu.be/xxx" \ -H "X-Api-Key: zxxo_xxx" \ -o audio.mp3 # Check status API key curl "http://68.183.17.236:3000/api/key-info" \ -H "X-Api-Key: zxxo_xxx" # Generate / ambil key (1 device 1 key) curl -X POST "http://68.183.17.236:3000/api/generate-key" \ -H "Content-Type: application/json"
python
import requests ZEXXO_KEY = "zxxo_xxxxxxxxxxxxxxxx" BASE_URL = "http://68.183.17.236:3000/api" HEADERS = {"X-Api-Key": ZEXXO_KEY} # Download YouTube MP4 def download_ytmp4(url, resolution="720"): res = requests.get( f"{BASE_URL}/download/ytmp4", params={"url": url, "resolution": resolution}, headers=HEADERS, stream=True ) with open("video.mp4", "wb") as f: for chunk in res.iter_content(8192): f.write(chunk) print("โœ… Saved video.mp4") download_ytmp4("https://youtu.be/xxx")
Error Codes
โš ๏ธ Semua Error Codes โ–พ
400
INVALID_INPUT
Field wajib kosong atau format URL salah
401
MISSING_KEY
Header X-Api-Key tidak disertakan dalam request
403
INVALID_KEY
API key salah, tidak ditemukan, atau sudah di-revoke
403
DEVICE_MISMATCH
Key digunakan dari device berbeda โ€” otomatis di-revoke sebagai proteksi
404
NOT_FOUND
Endpoint yang diminta tidak ada
429
RATE_LIMITED
Melebihi batas 60 request per menit
500
INTERNAL_ERROR
Server error tidak terduga, coba lagi
502
UPSTREAM_ERROR
Layanan sumber tidak tersedia atau timeout
json ยท error format
{ "status": 403, "error": "DEVICE_MISMATCH", "message": "Key ini terikat ke device lain..." }
๐Ÿ”‘ Key Management API โ–พ
POST
/api/generate-key
Buat atau ambil key untuk device ini. 1 device 1 key aktif.
GET
/api/key-info
Cek info key: label, tanggal buat, total request. Header: X-Api-Key
DEL
/api/revoke-key
Revoke key secara permanen. Tidak bisa dibatalkan.
Spesifikasi
Runtime
Node.js
Framework
Express
Auth
Device Key
Rate Limit
60/min
DB
JSON File
Version
3.0.0