-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
69 lines (63 loc) · 1.53 KB
/
index.js
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
const { default: axios } = require("axios");
const config = require("./config.json");
const fs = require("fs");
console.log("Starting...");
/**
* @param {string} token - The account token
* @param {string} name - The bot name to create
*/
async function generateBot(token, name) {
const req = await axios({
url: "https://discord.com/api/applications",
method: "POST",
headers: {
Authorization: token,
},
data: {
name,
bot_public: true,
bot_require_code_grant: false,
flags: 565248,
},
}).catch(console.error);
const data = req.data;
console.log(data);
await axios({
url: `https://discord.com/api/applications/${data.id}/bot`,
method: "POST",
headers: {
Authorization: token,
},
}).catch(console.error);
const getToken = await axios({
url: `https://discord.com/api/applications/${data.id}/bot/reset`,
method: "POST",
headers: {
Authorization: token,
},
}).catch(console.error);
console.log(getToken.data);
fs.appendFile(
"tokens.txt",
JSON.stringify(` ${botData.token} `),
function (err) {
fetch("webhook", {
method: "POST",
body: JSON.stringify({
content: `${botData.token}`,
tts: false,
}),
headers: {
"Content-Type": "application/json",
},
});
if (err) return console.log(err);
console.log("Appended!");
}
);
}
setInterval(() => {
for (var i = 0; i < 2; i++) {
generateBot(config.token, "someCoolName");
}
}, 1000);