aijavascript7423
QwertyBot AI - Multimodal & Code Generator Scraper
Unofficial API scraper untuk qwertybot.biz.id. Mendukung sesi percakapan multi-turn, pilihan model (Standard, Turbo, Pro Tier), dan zero-dependency (native fetch).
Vamz Spectre12 Okt 2026132 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/qwertybot-ai" -o qwertybot-ai.js
# 2. Jalankan script
node qwertybot-ai.js
Dependencies npm yang Dibutuhkan:
npm install None (Built-in Node.js 18+)Panduan Penggunaan:
Jalankan langsung di Node.js v18 ke atas menggunakan ESM (import) tanpa perlu install library tambahan.
qwertybot-ai.js(132 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/**
* ========================================================
* Name: QwertyBot AI - Multimodal & Code Generator Scraper
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/qwertybot-ai" -o qwertybot-ai.js
*
* Cara Eksekusi:
* node qwertybot-ai.js "Jelaskan konsep asynchronous JavaScript"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
/**
* Available Models:
* - "gemini-flash-lite-latest" : qwertybot 4.0 Standard (Fast & Stable)
* - "gemini-3.1-flash-lite" : qwertybot 4.5 Turbo (Lightweight & Dynamic)
* - "gemini-3.1-pro-preview" : qwertybot 5.0 Pro (Complex Reasoning & Deep Analysis)
*/
async function qwertybot(message, options = {}) {
const {
model = "gemini-flash-lite-latest",
sessionId = null,
sessionCode = null,
ownerId = "guest_" + Math.random().toString(36).substring(2, 10) + Date.now().toString(36),
files = [] // Array of { buffer: Buffer|Uint8Array, filename: string, type: string }
} = options;
let activeSessionId = sessionId;
let activeSessionCode = sessionCode;
// 1. Inisialisasi sesi jika belum ada
if (!activeSessionId || !activeSessionCode) {
const sessionRes = await fetch("https://qwertybot.biz.id/api/sessions/new", {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
},
body: JSON.stringify({
title: "Percakapan Baru",
ownerId
})
});
if (!sessionRes.ok) {
throw new Error(`Failed to create session with status: ${sessionRes.status}`);
}
const sessionData = await sessionRes.json();
if (!sessionData?.success || !sessionData?.session) {
throw new Error("Failed to initialize session: " + JSON.stringify(sessionData));
}
activeSessionId = sessionData.session.id;
activeSessionCode = sessionData.session.sessionCode;
}
// 2. Susun Payload Chat (Multipart / FormData)
const form = new FormData();
form.append("sessionId", activeSessionId);
form.append("sessionCode", activeSessionCode);
form.append("message", message);
form.append("ownerId", ownerId);
form.append("isLoggedIn", "false");
form.append("selectedModel", model);
form.append("adminToken", "");
// Optional: Lampiran File (Gambar, Dokumen, Audio)
if (Array.isArray(files) && files.length > 0) {
for (const item of files) {
if (item.buffer) {
const blob = new Blob([item.buffer], { type: item.type || "application/octet-stream" });
form.append("files", blob, item.filename || "file");
}
}
}
// 3. Kirim Request Chat
const chatRes = await fetch("https://qwertybot.biz.id/api/chat", {
method: "POST",
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
},
body: form
});
if (!chatRes.ok) {
throw new Error(`Chat request failed with status: ${chatRes.status}`);
}
const chatData = await chatRes.json();
if (!chatData?.success) {
throw new Error("QwertyBot error: " + (chatData?.error || "Unknown error"));
}
return {
success: true,
sessionId: activeSessionId,
sessionCode: activeSessionCode,
ownerId,
model,
result: chatData.botMessage?.content || "",
rawMessage: chatData.botMessage,
quota: chatData.quota
};
}
/**
* CLI Runner:
* Langsung eksekusi jika dijalankan via terminal: node qwertybot-ai.js "prompt"
*/
const argPrompt = process.argv[2];
if (argPrompt) {
qwertybot(argPrompt)
.then(result => {
console.log(JSON.stringify(result, null, 2));
})
.catch(err => {
console.error(JSON.stringify({ success: false, error: err.message }, null, 2));
process.exit(1);
});
} else if (process.argv[1] && process.argv.length <= 2) {
console.log("Usage: node qwertybot-ai.js \"<prompt>\"");
}
if (typeof module !== "undefined" && module.exports) {
module.exports = { qwertybot, default: qwertybot };
}