Compare commits
No commits in common. "7c202dfa3c05f8b27cccc7518584ea8d73d02e7f" and "1a8f4e8ae95a836288a99b59534267b9474bbead" have entirely different histories.
7c202dfa3c
...
1a8f4e8ae9
28
index.ts
28
index.ts
@ -1,4 +1,4 @@
|
|||||||
import { Client, Guild, Permissions } from 'discord.js-selfbot-v13';
|
import { Client, Guild } from 'discord.js-selfbot-v13';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
class InfoClient extends Client {
|
class InfoClient extends Client {
|
||||||
@ -18,35 +18,27 @@ class InfoClient extends Client {
|
|||||||
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 }> } } } = {};
|
const guildData: { [key: string]: { [key: string]: string[] } } = {};
|
||||||
|
|
||||||
this.guilds.cache.forEach((guild: Guild) => {
|
this.guilds.cache.forEach((guild: Guild) => {
|
||||||
const guildInfo: { [key: string]: { channels: Record<string, { channelname: string, channeltype: string, access: boolean }> } } = {};
|
const guildInfo: { [key: string]: string[] } = {};
|
||||||
console.log(`Guild: ${guild.name}`);
|
console.log(`Guild: ${guild}`);
|
||||||
guild.channels.cache.forEach(channel => {
|
const channels = guild.channels.cache;
|
||||||
if (channel.type !== 'GUILD_CATEGORY') {
|
console.log(`There are ${channels.size} channels in the guild.`);
|
||||||
|
channels.forEach(channel => {
|
||||||
|
if (channel && channel.type !== 'GUILD_CATEGORY') {
|
||||||
const categoryName = channel.parent?.name || 'Uncategorized';
|
const categoryName = channel.parent?.name || 'Uncategorized';
|
||||||
const categoryID = channel.parent?.id || 'Uncategorized';
|
const categoryID = channel.parent?.id || 'Uncategorized';
|
||||||
|
|
||||||
if (!guildInfo[categoryName]) {
|
if (!guildInfo[categoryName]) {
|
||||||
guildInfo[categoryName] = { channels: {} };
|
guildInfo[categoryName] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let access = false;
|
guildInfo[categoryName].push(`${channel.name} (${channel.type} ${channel.id})`);
|
||||||
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;
|
guildData[guild.name] = guildInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
const filename = `output/${this.user?.tag} ${this.token.slice(-5)}.json`;
|
const filename = `output/${this.user?.tag} ${this.token.slice(-5)}.json`;
|
||||||
const jsonData = JSON.stringify(guildData, null, 2);
|
const jsonData = JSON.stringify(guildData, null, 2);
|
||||||
fs.writeFileSync(filename, jsonData);
|
fs.writeFileSync(filename, jsonData);
|
||||||
|
Loading…
Reference in New Issue
Block a user