-
Notifications
You must be signed in to change notification settings - Fork 118
/
index.js
177 lines (161 loc) · 5.73 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// this has been patched.
// to purchase a private joiner and boost tool, dm me on discord @uutu or on telegram @tahagorme
const chalk = require("chalk")
console.log(`This script has been patched, to purchase the unpatched version, contact me on discord @uutu or on telegram @tahagorme`)
process.on("unhandledRejection", (reason, promise) => {
console.log(
`${chalk.redBright(
"[ERROR]"
)} Unhandled rejection at ${promise}, reason: ${reason}`
)
// Application specific logging, throwing an error, or other logic here
})
process.on("uncaughtException", (err, origin) => {
console.log(
`${chalk.redBright("[ERROR]")} Uncaught exception: ${err} at ${origin}`
)
// Application specific logging, throwing an error, or other logic here
})
const gradient = require("gradient-string")
const config = require("./config.json")
const { Client } = require("discord.js-selfbot-v13")
var totalJoined = 0
var failed = 0
var invite = config.invite
if (invite.includes(".")) {
inviteCode = invite.match(/\/([^/]+)$/)?.[1] || ""
} else {
inviteCode = invite
}
const HttpsProxyAgent = require("https-proxy-agent")
const fs = require("fs")
//read from tokens.txt
console.log(gradient.rainbow("Token Joiner by @uutu"))
async function readTokens() {
const tokens = fs.readFileSync("tokens.txt").toString().split("\n")
for (i in tokens) {
await new Promise((resolve) => setTimeout(resolve, i * config.joinDelay))
doEverything(
tokens[i]?.trim()?.replace("\r", "")?.replace("\n", ""),
tokens
)
}
}
readTokens()
const proxies = fs.readFileSync("proxies.txt").toString().split("\n")
async function doEverything(token, tokens) {
const randomProxy = proxies[Math.floor(Math.random() * proxies.length)]
?.replace("\r", "")
?.replace("\n", "")
var client
if (config.useProxies) {
var agent = HttpsProxyAgent(randomProxy)
client = config.captcha_api_key
? new Client({
captchaService: config.captcha_service.toLowerCase(),
captchaKey: config.captcha_api_key,
checkUpdate: false,
http: { agent: agent },
captchaWithProxy: true,
proxy: randomProxy,
restRequestTimeout: 60 * 1000,
interactionTimeout: 60 * 1000,
restWsBridgeTimeout: 5 * 1000,
})
: new Client({ checkUpdate: false })
} else {
client = config.captcha_api_key
? new Client({
captchaService: config.captcha_service.toLowerCase(),
captchaKey: config.captcha_api_key,
checkUpdate: false,
})
: new Client({ checkUpdate: false })
}
client.on("ready", async () => {
console.log(
chalk.green("Logged in as ") + gradient.cristal(client.user.tag)
)
await client
.fetchInvite(inviteCode)
.then(async (invite) => {
await invite
.acceptInvite(true)
.then(async () => {
console.log(
chalk.greenBright(
`Joined as ${gradient.passion(client.user.tag)}`
)
)
totalJoined++
process.title = `Joined: ${totalJoined} | Failed: ${failed}`
if (client.token === tokens[tokens.length - 1]) {
console.log(
`${chalk.magentaBright("[INFO]")} Joined ${gradient.passion(
totalJoined
)} servers and failed to join ${gradient.passion(
failed
)} servers`
)
process.title = `Joined: ${totalJoined} | Failed: ${failed}`
}
if (config.boost.enabled) {
setTimeout(async () => {
const allBoosts = await client.billing.fetchGuildBoosts()
allBoosts.each(async (boost) => {
await boost.unsubscribe().catch((err) => {})
setTimeout(async () => {
await boost.subscribe(config.boost.serverId)
console.log(
`${chalk.greenBright(
"[SUCCESS]"
)} Boosted Server as ${gradient.cristal(
client.user.tag
)}`
)
}, 500)
})
}, config.boost.delay)
}
})
.catch((err) => {
console.log(
`${chalk.redBright("[ERROR]")} Failed to join as ${gradient.fruit(
client.user.tag
)}`
)
failed++
process.title = `Joined: ${totalJoined} | Failed: ${failed}`
console.error(chalk.redBright(err))
if (client.token === tokens[tokens.length - 1]) {
console.log(
`${chalk.magentaBright("[INFO]")} Joined ${gradient.passion(
totalJoined
)} servers and failed to join ${gradient.passion(
failed
)} servers`
)
process.title = `Joined: ${totalJoined} | Failed: ${failed}`
}
})
})
.catch((err) => {
if (err.toString().includes("Unknown Invite"))
return console.log(`${chalk.redBright("[ERROR]")} Unknown Invite: The provided invite (${inviteCode}) is invalid or formatted incorrectly.`)
console.error(err)
})
})
client.login(token).catch((err) => {
console.log(
`${chalk.redBright("[ERROR]")} Invalid token ${gradient.instagram(token)}`, err
)
if (client.token === tokens[tokens.length - 1]) {
console.log(
`${chalk.magentaBright("[INFO]")} Joined ${gradient.passion(
totalJoined
)} servers and failed to join ${gradient.passion(failed)} servers`
)
process.title = `Joined: ${totalJoined} | Failed: ${failed}`
}
})
}