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
742 stars 160 forks source link

Wrong token returned from DiscordAuthWebsocket #267

Closed Naozumi520 closed 2 years ago

Naozumi520 commented 2 years ago

Which package has the bugs?

The core library

Issue description

Scan the QR code to log in then token is logged, but the token is different each time and it is wrong. (Tried it twice and the token is highlighted below:)

token_tem

Code sample

const { Client, DiscordAuthWebsocket } = require('discord.js-selfbot-v13')

const AuthWebsocket = new DiscordAuthWebsocket()
  AuthWebsocket.connect()
  AuthWebsocket.on('ready', (_, url) => {
    // prompt.webContents.send('event', { action: 'qrRen', args: { qrCodeUrl: url } })
    // prompt.show()
    console.log('qr Ready!')
  })
    .on('finish', (_, token) => {
          console.log(token)
          // storage.set('discordToken', { token: token })
          // prompt.destroy()
    });

Package version

discord.js-selfbot-v13@2.6.4

Node.js version

v18.3.0

Operating system

macOS 13.0 Beta (22A5311f)

Priority this issue should have

Medium (should be fixed soon)

Checklist

Additional Information

No response

aiko-chan-ai commented 2 years ago

each time you do RemoteAuth you have generated a random RSA key. So the hash of the token will be different every time it is used. Please save the token after scanning the QR code, it will always work

Naozumi520 commented 2 years ago

I saved the token and try to login with it, however, everytime I log in with the token, it keeps saying the token is invalid. Scanning the QR code also doesn't log the library in. 🥹

aiko-chan-ai commented 2 years ago

I saved the token and try to login with it, however, everytime I log in with the token, it keeps saying the token is invalid. Scanning the QR code also doesn't log the library in. 🥹

I will check again (will fix if there is an error in the next 1 hour)

aiko-chan-ai commented 2 years ago

ohhhhh i found the problem: v Discord changed the way remote authentication works by adding a new endpoint (I omitted it)

aiko-chan-ai commented 2 years ago

image

aiko-chan-ai commented 2 years ago

ohhhhh i found the problem: v Discord changed the way remote authentication works by adding a new endpoint (I omitted it)

@Naozumi520 ok latest :))

Naozumi520 commented 2 years ago

Sadly, when I login with the token this error was shown 🥲:

Uncaught Exception:
TypeError: Cannot read properties of undefined (reading 'rawSetting')
    at Client.customStatusAuto (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/Client.js:813:24)
    at Object.module.exports [as READY] (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/handlers/READY.js:140:12)
    at WebSocketManager.handlePacket (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js:359:31)
    at WebSocketShard.onPacket (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:482:22)
    at WebSocketShard.onMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:317:10)
    at WebSocket.onMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:390:28)
    at Receiver.receiverOnMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/websocket.js:1178:20)
    at Receiver.emit (node:events:390:28)
    at Receiver.dataMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/receiver.js:528:14)
aiko-chan-ai commented 2 years ago

Sadly, when I login with the token this error was shown 🥲:

Uncaught Exception:
TypeError: Cannot read properties of undefined (reading 'rawSetting')
    at Client.customStatusAuto (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/Client.js:813:24)
    at Object.module.exports [as READY] (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/handlers/READY.js:140:12)
    at WebSocketManager.handlePacket (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js:359:31)
    at WebSocketShard.onPacket (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:482:22)
    at WebSocketShard.onMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:317:10)
    at WebSocket.onMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:390:28)
    at Receiver.receiverOnMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/websocket.js:1178:20)
    at Receiver.emit (node:events:390:28)
    at Receiver.dataMessage (/Users/yeungyathung/Desktop/discordOverlayMac/discordOverlayMacPro/node_modules/ws/lib/receiver.js:528:14)

fixed v2.6.6

Naozumi520 commented 2 years ago

fixed v2.6.6

Thanks! It's now working. 😋