Closed Turkidev closed 1 year ago
:skull:
huh?
please look at my code again
its now joining the channel but after 5s it leave without starting the screen
` case 'stream': async function startStreaming() { const { DiscordStreamClient } = await import('discord-stream-client'); const StreamClient = new DiscordStreamClient(client);
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) {
return message.channel.send('You need to join a voice channel first!');
}
const voiceConnection = await StreamClient.joinVoiceChannel(voiceChannel, {
selfDeaf: false,
selfMute: false,
selfVideo: false,
});
const streamConnection = await voiceConnection.createStream();
const player = StreamClient.createPlayer(
'https://dl2.issou.best/ordr/videos/render1046454.mp4', // DIRECT VIDEO URL OR READABLE STREAM HERE
streamConnection.udp, // UDP connection
);
player.play();
setTimeout(() => {
StreamClient.pauseScreenShare(true);
}, 30_000);
message.channel.send(`Streaming started at ${voiceChannel}`);
}
startStreaming().catch((error) => {
console.error('Error starting stream:', error);
});
break;`
Error starting stream: TypeError: this.client.removeListener is not a function at DiscordStreamClient.unpatch (file:///root/show_vc/node_modules/discord-stream-client/src/index.js:23:15) at DiscordStreamClient.patch (file:///root/show_vc/node_modules/discord-stream-client/src/index.js:19:8) at DiscordStreamClient.joinVoiceChannel (file:///root/show_vc/node_modules/discord-stream-client/src/index.js:86:8) at startStreaming (/root/show_vc/index.js:1400:72)