Not receiving events

so im trying to listen to voice events but i dont receive anything. I don't receive speaking events nor the received bytes... what could it cause? the bot is in my voice call and its not deafened AscShrug the code snippet:
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
selfDeaf: false,
selfMute: true,
adapterCreator: guild.voiceAdapterCreator,
})
const silentFrame = new Uint8Array([0xF8, 0xFF, 0xFE]);
connection.prepareAudioPacket(Buffer.from(silentFrame))
connection.dispatchAudio()

const receiver = connection.receiver;

class StreamTransform extends Transform {
constructor() {
super({objectMode: true});
}

_transform(data: Uint8Array, encoding: string, callback: () => void) {
console.log('Received data:', data);
// NEVER PRINTED OUT
this.push(data);
callback();
}
}

receiver.speaking.on("start", userId => {
// NEVER PRINTED OUT
console.log(userId + " is speaking")
const stream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.Manual
},
})
const transform = new StreamTransform()
pipeline(stream, transform, (error) => {
console.log("error")
})
})
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
selfDeaf: false,
selfMute: true,
adapterCreator: guild.voiceAdapterCreator,
})
const silentFrame = new Uint8Array([0xF8, 0xFF, 0xFE]);
connection.prepareAudioPacket(Buffer.from(silentFrame))
connection.dispatchAudio()

const receiver = connection.receiver;

class StreamTransform extends Transform {
constructor() {
super({objectMode: true});
}

_transform(data: Uint8Array, encoding: string, callback: () => void) {
console.log('Received data:', data);
// NEVER PRINTED OUT
this.push(data);
callback();
}
}

receiver.speaking.on("start", userId => {
// NEVER PRINTED OUT
console.log(userId + " is speaking")
const stream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.Manual
},
})
const transform = new StreamTransform()
pipeline(stream, transform, (error) => {
console.log("error")
})
})
@discordjs/voice ^0.16.0 discord.js ^14.11.0 Can anyone help me out?
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
marian
marianOP2y ago
Yes it’s in my voice channel
Want results from more Discord servers?
Add your server