Compare commits
	
		
			5 Commits
		
	
	
		
			92d22d7ef0
			...
			216bb7a672
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 216bb7a672 | |||
| f51f7e66c0 | |||
| 8e8906d50a | |||
| f0891322b5 | |||
| 9fe5ccc308 | 
							
								
								
									
										59
									
								
								index.ts
									
									
									
									
									
								
							
							
						
						
									
										59
									
								
								index.ts
									
									
									
									
									
								
							| @@ -1,32 +1,75 @@ | |||||||
| import { Client, Guild } from 'discord.js-selfbot-v13'; | import { Client, Guild } from 'discord.js-selfbot-v13'; | ||||||
|  | import fs from 'fs'; | ||||||
| const token = ''; |  | ||||||
|  |  | ||||||
| class InfoClient extends Client { | class InfoClient extends Client { | ||||||
|   public constructor() { |   public token: string; | ||||||
|  |  | ||||||
|  |   public constructor(token: string) { | ||||||
|     super(); |     super(); | ||||||
|  |     this.token = token; | ||||||
|     this.init(); |     this.init(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   private async init(): Promise<void> { |   private async init(): Promise<void> { | ||||||
|     this.once('ready', () => this.onReady()); |   	this.once('ready', () => this.onReady()); | ||||||
|     await this.login(token); |   	await this.login(this.token); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   private onReady(): void { |   private onReady(): void { | ||||||
|     console.log(`Logged in as ${this.user?.tag}!`); |     console.log(`Logged in as ${this.user?.tag}!`); | ||||||
|  | 	 | ||||||
|  |     const guildData: { [key: string]: { [key: string]: string[] } } = {}; | ||||||
|  |  | ||||||
|     this.guilds.cache.forEach((guild: Guild) => { |     this.guilds.cache.forEach((guild: Guild) => { | ||||||
|  | 	    const guildInfo: { [key: string]: string[] } = {}; | ||||||
| 	    console.log(`Guild: ${guild}`); | 	    console.log(`Guild: ${guild}`); | ||||||
| 	    const channels = guild.channels.cache; | 	    const channels = guild.channels.cache; | ||||||
| 	    console.log(`There are ${channels.size} channels in the guild.`); | 	    console.log(`There are ${channels.size} channels in the guild.`); | ||||||
| 	    channels.forEach(channel => { | 	    channels.forEach(channel => { | ||||||
| 		    console.log(`- ${channel.name} (${channel.type} ${channel.id})`); | 		    if (channel && channel.type !== 'GUILD_CATEGORY') { | ||||||
|  |                 const categoryName = channel.parent?.name || 'Uncategorized'; | ||||||
|  |                 const categoryID = channel.parent?.id || 'Uncategorized'; | ||||||
|  |  | ||||||
|  |                 if (!guildInfo[categoryName]) { | ||||||
|  |                      guildInfo[categoryName] = []; | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 guildInfo[categoryName].push(`${channel.name} (${channel.type} ${channel.id})`); | ||||||
|  |             } | ||||||
| 	    }); | 	    }); | ||||||
|  | 	    guildData[guild.name] = guildInfo; | ||||||
|     }); |     }); | ||||||
|     process.exit(); |     const filename = `output/${this.user?.tag} ${this.token.substring(0, 5)}.json`; | ||||||
|  |     const jsonData = JSON.stringify(guildData, null, 2); | ||||||
|  |     fs.writeFileSync(filename, jsonData); | ||||||
|  |     console.log(`Data saved to ${filename}`); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| new InfoClient(); | async function createInfoClientsFromFile(filePath: string): Promise<void> { | ||||||
|  |   try { | ||||||
|  |     const tokens = fs.readFileSync(filePath, 'utf-8').split('\n').map(token => token.trim()); | ||||||
|  |  | ||||||
|  |     const clientPromises = tokens.map(async token => { | ||||||
|  |       if (token) {  | ||||||
|  |         const client = new InfoClient(token); | ||||||
|  |         await client.login(token); | ||||||
|  |         console.log(`Logged in with token: ${token}`); | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     await Promise.all(clientPromises); | ||||||
|  |  | ||||||
|  |     console.log("All clients logged in successfully."); | ||||||
|  |     process.exit(); | ||||||
|  |   } catch (error) { | ||||||
|  |     console.error('Error creating InfoClients:', error); | ||||||
|  |     process.exit(1); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | const tokensFilePath = 'tokens.txt'; | ||||||
|  | createInfoClientsFromFile(tokensFilePath).catch(err => { | ||||||
|  |   console.error('Error creating InfoClients:', err); | ||||||
|  | }); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user