Loop over every token in tokens.txt and get all the channels
This commit is contained in:
parent
8e8906d50a
commit
f51f7e66c0
22
index.ts
22
index.ts
@ -1,17 +1,19 @@
|
||||
import { Client, Guild } from 'discord.js-selfbot-v13';
|
||||
import fs from 'fs';
|
||||
|
||||
const token = '';
|
||||
|
||||
class InfoClient extends Client {
|
||||
public constructor() {
|
||||
public token: string;
|
||||
|
||||
public constructor(token: string) {
|
||||
super();
|
||||
this.token = token;
|
||||
this.init();
|
||||
}
|
||||
|
||||
private async init(): Promise<void> {
|
||||
this.once('ready', () => this.onReady());
|
||||
await this.login(token);
|
||||
await this.login(this.token);
|
||||
}
|
||||
|
||||
private onReady(): void {
|
||||
@ -38,12 +40,22 @@ class InfoClient extends Client {
|
||||
});
|
||||
guildData[guild.name] = guildInfo;
|
||||
});
|
||||
const filename = `${this.user?.tag}[${token.substring(0, 5)}].json`;
|
||||
const filename = `${this.user?.tag} ${this.token.substring(0, 5)}.json`;
|
||||
const jsonData = JSON.stringify(guildData, null, 2);
|
||||
fs.writeFileSync(filename, jsonData);
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
|
||||
new InfoClient();
|
||||
function createInfoClientsFromFile(filePath: string): void {
|
||||
const tokens = fs.readFileSync(filePath, 'utf-8').split('\n').map(token => token.trim());
|
||||
|
||||
tokens.forEach(token => {
|
||||
if (token) {
|
||||
new InfoClient(token);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const tokensFilePath = 'tokens.txt';
|
||||
createInfoClientsFromFile(tokensFilePath);
|
||||
|
Loading…
Reference in New Issue
Block a user