Open Jaro-c opened 1 month ago
There might have been an error; I'll check it later (this weekend).
I try to do some code. For me everything work.
client.on('voiceStateUpdate', (oldState, newState) => {
if (!oldState.channel && newState.channel) console.log(`${newState.user.username} has joined a voice channel`);
else if (oldState.channel && !newState.channel) console.log(`${oldState.user.username} left a channel`);
else if (!oldState.streaming && newState.streaming) console.log(`${newState.user.username} start a stream`)
else if (oldState.streaming && !newState.streaming) console.log(`${oldState.user.username} stop a stream`)
})
I try to do some code. For me everything work.
client.on('voiceStateUpdate', (oldState, newState) => { if (!oldState.channel && newState.channel) console.log(`${newState.user.username} has joined a voice channel`); else if (oldState.channel && !newState.channel) console.log(`${oldState.user.username} left a channel`); else if (!oldState.streaming && newState.streaming) console.log(`${newState.user.username} start a stream`) else if (oldState.streaming && !newState.streaming) console.log(`${oldState.user.username} stop a stream`) })
It seems like you might be using a different version of the library because the code you shared doesn’t seem to work as expected in the version I’m using (3.3.0).
If you want to give it a try, I’m currently using version 3.3.0 of discord.js-selfbot-v13. Here’s an example you can test:
const { Client } = require("discord.js-selfbot-v13");
const client = new Client({ presence: { status: "invisible" } });
// Event: Voice Streaming
client.on("voiceStateUpdate", async (oldState, newState) => {
console.log(oldState.streaming, "|", newState.streaming);
});
client.login("YOUR_TOKEN_HERE");
This should print true | true
when someone stops streaming in the channel.
Ofc i was using the latest version, but yea you're right. It log true | true
when stopping streaming and leaving the channel.
sorry, I've been busy with college admissions lately ;-;
Which package has the bugs?
The core library
Issue description
I'm encountering an issue with the
voiceStateUpdate
event indiscord.js-selfbot-v13@3.3.0
. The problem occurs specifically when trying to detect changes in a user's streaming state. Below is a detailed explanation of the issue:Joining a Voice Channel:
oldState.streaming
andnewState.streaming
arenull
. This is the expected behavior.Starting a Stream:
oldState.streaming
isnull
, andnewState.streaming
correctly returnstrue
, which is the expected behavior.Stopping the Stream:
oldState.streaming
andnewState.streaming
incorrectly returntrue
.Code sample
Package version
discord.js-selfbot-v13@3.3.0
Node.js version
v20.13.1
Operating system
Windows 11
Priority this issue should have
Medium (should be fixed soon)
Checklist
Additional Information
No response