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
825 stars 170 forks source link

Uncaught TypeError TypeError: Cannot read properties of null (reading 'send') #1281

Closed NotserpPL closed 2 months ago

NotserpPL commented 2 months ago

Which package has the bugs?

The core library

Issue description

  1. Use code with discord-js-selfbot-v13
  2. Get error
  3. Uncaught TypeError TypeError: Cannot read properties of null (reading 'send') at _send (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:775:21) at processQueue (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:797:12) at send (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:759:10) at identifyNew (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:722:10) at identify (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:688:58) at (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:248:14) at connect (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:210:12) at createShards (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:241:19) at connect (c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:161:17) at processTicksAndRejections (internal/process/task_queues:95:5)

Code sample

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();

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

client.login('token');

Package version

2.3.0

Node.js version

v22.6.0

Operating system

Windows 11

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

zrSadek commented 2 months ago

wrong provided code

NotserpPL commented 2 months ago

wrong provided code

wdym? it's literally from the example

zrSadek commented 2 months ago

u gave const { Client } = require('discord.js-selfbot-v13'); const client = new Client();

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

client.login('token'); as the code but the error said u are using a webhook

NotserpPL commented 2 months ago

u gave const { Client } = require('discord.js-selfbot-v13'); const client = new Client();

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

client.login('token'); as the code but the error said u are using a webhook

how i am using webhook lool, i did use the example code with my token and im gettin this error, also the library worked for me before, but now it stopped for some reason with that error

TheDevYellowy commented 2 months ago

that is technically the correct provided code, if you look at the error the error is originating from c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:775:21 which is in this repo. It looks like somehow the WebSocketShard is trying to send information before a WebSocket connection can be initialized

NotserpPL commented 2 months ago

that is technically the correct provided code, if you look at the error the error is originating from c:\Users\imfil\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketShard.js:775:21 which is in this repo. It looks like somehow the WebSocketShard is trying to send information before a WebSocket connection can be initialized

can i fix it somehow? or smh

NotserpPL commented 2 months ago

on replit theres another error: /home/runner/[MY REPO NAME]/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js:244 throw new Error(WSCodes[error.code]); ^

Error [INVALID_INTENTS]: [Bot Token] Invalid intent provided for WebSocket intents. at WebSocketManager.createShards (/home/runner/[MY REPO NAME]/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js:244:15) at async Client.login (/home/runner/[MY REPO NAME]/node_modules/discord.js-selfbot-v13/src/client/Client.js:267:7) {

}

TheDevYellowy commented 2 months ago

Repit has banned selfbots

NotserpPL commented 2 months ago

Repit has banned selfbots

oh okay

aiko-chan-ai commented 2 months ago

I can't reproduce this error, but it seems like there are some network issues causing the queue to start sending before the WebSocket connection is established.