Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ async function run() {
headless: config.headless,
executablePath: config.chromePath
});

let initPage = await (await browser.pages())[0];

fs.readdirSync('./cookies').filter(filename => filename.endsWith('.json')).forEach(async filename => {
let context = await browser.createIncognitoBrowserContext();
Expand All @@ -44,6 +46,7 @@ async function run() {

client.once('ready' , c => {
console.log(`[Discord] Logged in as ${c.user.tag} (${client.user.id})`);
initPage.close();
})

client.on('messageCreate', async message => {
Expand All @@ -55,8 +58,6 @@ async function run() {
})

client.login(config.discord_token);

// await browser.close();
}

const wait = ms => {
Expand Down Expand Up @@ -334,4 +335,4 @@ Discord.Message.prototype.getCode = function() {
return false;
}

run();
run();