Compare commits

..

8 Commits

Author SHA1 Message Date
7c202dfa3c Change writing format 2024-06-28 01:56:26 +02:00
ad7f6dcee6 Add display to show if user has permissions to channel or no 2024-06-28 01:48:09 +02:00
1a8f4e8ae9 Last chars of token 2024-06-28 01:37:27 +02:00
216bb7a672 Write to file 2024-06-28 01:35:13 +02:00
f51f7e66c0 Loop over every token in tokens.txt and get all the channels 2024-06-28 01:25:27 +02:00
8e8906d50a Add output to file 2024-06-28 01:16:25 +02:00
f0891322b5 Output as json 2024-06-28 01:03:43 +02:00
9fe5ccc308 Save in json format 2024-06-28 00:59:36 +02:00

View File

@@ -1,32 +1,83 @@
import { Client, Guild } from 'discord.js-selfbot-v13'; import { Client, Guild, Permissions } 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]: { channels: Record<string, { channelname: string, channeltype: string, access: boolean }> } } } = {};
this.guilds.cache.forEach((guild: Guild) => { this.guilds.cache.forEach((guild: Guild) => {
console.log(`Guild: ${guild}`); const guildInfo: { [key: string]: { channels: Record<string, { channelname: string, channeltype: string, access: boolean }> } } = {};
const channels = guild.channels.cache; console.log(`Guild: ${guild.name}`);
console.log(`There are ${channels.size} channels in the guild.`); guild.channels.cache.forEach(channel => {
channels.forEach(channel => { if (channel.type !== 'GUILD_CATEGORY') {
console.log(`- ${channel.name} (${channel.type} ${channel.id})`); const categoryName = channel.parent?.name || 'Uncategorized';
}); const categoryID = channel.parent?.id || 'Uncategorized';
if (!guildInfo[categoryName]) {
guildInfo[categoryName] = { channels: {} };
}
let access = false;
if (channel.permissionsFor(this.user!)?.has(Permissions.FLAGS.VIEW_CHANNEL)) {
access = true;
}
guildInfo[categoryName].channels[channel.id] = {
channelname: channel.name,
channeltype: channel.type,
access: access
};
}
});
guildData[guild.name] = guildInfo;
}); });
process.exit();
const filename = `output/${this.user?.tag} ${this.token.slice(-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);
});