aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

Selfbot stops working if I am not logged into Discord manually #647

Closed Ivansing23 closed 1 year ago

Ivansing23 commented 1 year ago

Which package has the bugs?

The core library

Issue description

When I try to access a user account using my token, it only works if I have my Discord account manually open on my computer. If I log out of the account and try to use the bot, it throws an error. I don't know if that is possible to correct at all, but if it is please fix it or tell me how to make it work. I'm kind of new to this. But this just seems like a major issue

Code sample

const { Client } = require('discord.js-selfbot-v13');
const client = new Client({
    // See other options here
    // https://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/ClientOptions
    // All partials are loaded automatically
});

client.on('ready', async () => {
  console.log(`${client.user.username} is ready!`);
})

client.login('my_discord_token_goes_here');

Package version

-- discord.js-selfbot-v13@2.13.6

Node.js version

v18.16.0

Operating system

Windows

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

C:\Users\ivans\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:265 throw new Error(WSCodes[error.code]); ^

Error [TOKEN_INVALID]: An invalid token was provided. at WebSocketManager.createShards (C:\Users\ivans\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:265:15) at async Client.login (C:\Users\ivans\node_modules\discord.js-selfbot-v13\src\client\Client.js:354:7) {

}

Node.js v18.16.0

Here is the error it gives me

TheDevYellowy commented 1 year ago

that's because when you log out of your account discord revokes that token and changes it for the next session / when you log in again to get around this log in inside of an incognito tab and you should be all good