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

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

Closed this issue · 10 comments

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

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

wrong provided code

wrong provided code

wdym? it's literally from the example

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

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

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

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

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) {
[Symbol(code)]: 'INVALID_INTENTS'
}

Repit has banned selfbots

Repit has banned selfbots

oh okay

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.