This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathindex.js
69 lines (55 loc) · 1.45 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
//Dependencies
const Request = require("request")
const Delay = require("delay")
//Variables
const Self_Args = process.argv.slice(2)
//Main
if(!Self_Args.length){
console.log("node index.js <channel_id> <discord_token> <amount>")
process.exit()
}
if(!Self_Args[0]){
console.log("Invalid channel_id.")
process.exit()
}
if(isNaN(Self_Args[0])){
console.log("channel_id is not an Int.")
process.exit()
}
if(!Self_Args[1]){
console.log("Invalid discord_token.")
process.exit()
}
if(!Self_Args[2]){
console.log("Invalid amount.")
process.exit()
}
if(isNaN(Self_Args[2])){
console.log("amount is not an Int.")
process.exit()
}
var self_index = 1
async function Spam(){
await Delay(2000)
Request.post(`https://discord.com/api/v9/channels/${Self_Args[0]}/invites`, {
headers: {
"Content-Type": "application/json",
"Authorization": Self_Args[1]
},
body: JSON.stringify({ "max_age": Math.floor(Math.random() * 604800), "max_uses": 0, "temporary": false })
}, function(err, res, body){
if(body.indexOf("Unknown Channel") !== -1){
console.log("Invalid channel_id.")
process.exit
}
if(body.indexOf("You are being rate limited.") !== -1){
Spam()
return
}
console.log(`Done! Index: ${self_index}`)
self_index += 1
})
}
for( let i = 0; i <= Self_Args[2]-1; i++ ){
Spam()
}