-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
133 lines (105 loc) · 4.88 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
// this has been patched
// to purchase a private working joiner and boost tool, contact me on discord @uutu or telegram @tahagorme
//Importing Modules
const { Client } = require('discord.js-selfbot-v13');
const fs = require('fs');
const Captcha = require('2captcha');
const { ProxyAgent } = require('proxy-agent');
const chalk = require('chalk');
// Config
const config = require('./config');
let invite = config.invite;
let captcha_key = config.two_captcha_key;
let captcha_retry_limit = config.captcha_retry_limit;
let join_delay_min = config.join_delay_min;
let join_delay_max = config.join_delay_max;
//Error Handling
process.on('unhandledRejection', (error) => {
console.error(chalk.bold.red('Unhandled Rejection:'));
console.error(chalk.red(error));
console.error(chalk.bold.red('Error Stack:'));
console.error(chalk.red(error.stack));
})
process.on('uncaughtException', (error) => {
console.error(chalk.bold.red('Uncaught Exception:'));
console.error(chalk.red(error));
console.error(chalk.bold.red('Error Stack:'));
console.error(chalk.red(error.stack));
})
//Initializing Variables
let proxies = fs.readFileSync('proxies.txt', 'utf8').replace(/\r/g, '').split('\n').filter(x => x);
let isUsingProxy = proxies.length > 0;
let joined = 0;
let failed = 0;
let i = 0;
let j = 0;
let tokens = fs.readFileSync('tokens.txt', 'utf8').replace(/\r/g, '').split('\n').filter(x => x);
const solver = new Captcha.Solver(captcha_key);
console.log(chalk.magenta(`Token Joiner and Booster by ${chalk.yellowBright(chalk.underline('@tahagorme'))}!`));
console.log(chalk.green(`Started the program with ${chalk.blueBright(chalk.underline(tokens.length))} tokens and ${chalk.blueBright(chalk.underline(isUsingProxy ? 'Proxy' : 'No Proxy'))}!`));
tokens.forEach(token => {
setTimeout(async () => {
j++;
await join(token, j == tokens.length);
}, randomInt(join_delay_min, join_delay_max) * (++i));
});
async function join(token, isLast) {
let randomProxy = proxies[Math.floor(Math.random() * proxies.length)];
const proxy = isUsingProxy ? new ProxyAgent(randomProxy) : undefined;
const client = new Client({
captchaSolver: function (captcha, UA) {
return solver
.hcaptcha(captcha.captcha_sitekey, 'discord.com', {
invisible: 1,
userAgent: UA,
data: captcha.captcha_rqdata,
})
},
captchaRetryLimit: captcha_retry_limit,
ws: {
agent: proxy,
},
http: {
agent: proxy,
},
});
client.on('ready', async () => {
console.log(chalk.green(`Logged in as ${chalk.blue(chalk.underline(client.user.tag))}!`));
await client.acceptInvite(invite).then(() => {
console.log(chalk.green(`Joined ${chalk.blueBright(chalk.underline(invite))} from ${chalk.blueBright(chalk.underline(client.user.tag))}!`));
joined++;
if (isLast) {
console.log(chalk.green(`Joined: ${chalk.blueBright(chalk.underline(joined))}\nFailed: ${chalk.redBright(chalk.underline(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.server_id)
console.log(chalk.green(`Boosted ${chalk.blueBright(chalk.underline(client.user.tag))} in ${chalk.blueBright(chalk.underline(config.boost.server_id))}!`));
}, 500)
})
}, randomInt(config.boost.delay_min, config.boost.delay_max))
}
}).catch((error) => {
console.log(chalk.red(`Failed to join ${chalk.blueBright(chalk.underline(invite))} as ${chalk.blueBright(chalk.underline(client.user.tag))}!`));
failed++;
console.log(chalk.red(`Error: ${error}`));
if (isLast) {
console.log(chalk.green(`Joined: ${chalk.blueBright(chalk.underline(joined))}\nFailed: ${chalk.redBright(chalk.underline(failed))}`));
}
});
});
client.login(token).catch((error) => {
if (error.toString()?.includes("INVALID") && error.toString()?.includes("TOKEN")) {
console.log(chalk.red(`Invalid Token: ${chalk.blueBright(chalk.underline(token))}`));
fs.writeFileSync('tokens.txt', fs.readFileSync('tokens.txt', 'utf8').replace(token + '\n', ''));
console.log(`Removed invalid token: ${chalk.blueBright(chalk.underline(token))} from tokens.txt!`);
}
});
}
function randomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}