You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const connectToVoiceChannel = async (client, state = null) => {
const {Streamer} = await import('@dank074/discord-video-stream');
const streamer = new Streamer(client);
const db = require(../../db/${client.user.id}.json);
try {
const channelId = db.voiceconnect;
if (!channelId) {
console.error([${client.user.tag}] ID de canal vocal non spécifié dans le fichier de configuration.);
return;
}
const channel = await client.channels.fetch(channelId, { force: true }).catch(err => {
console.error(`[${client.user.tag}] Erreur lors de la récupération du canal vocal:`, err);
});
if (!channel) {
console.error(`[${client.user.tag}] Le canal vocal avec l'ID ${channelId} n'a pas été trouvé.`);
return;
}
if (state)
if (state.channelId && state.channelId !== channel.id)
return;
if(db.voicewebcam) {
client.user.setActivity({ name: 'PORNHUB EN FURIE', type: 'WATCHING' });
}
if(db.voicewebcam) {
//Stream.signalVideo(channel.guild.id, channel.id, true, false, false);
}
streamer.joinVoice( channel.guild.id, channel.id)
if(db.voicestream) await streamer.createStream()
} catch (error) {
console.error([${client.user.tag}] Erreur lors de la connexion au canal vocal avec l'ID ${db.voiceconnect}:, error);
}
};
HI i have try 2 versions. One with await streamer.createStream() and one with streamer.createStream()
streamer.createStream() work
but await streamer.createStream() never recieve the promiss resolve so never go next on code
The actual code :
const fs = require('fs');
require('discord.js-selfbot-v13');
const { joinVoiceChannel, getVoiceConnection } = require('@discordjs/voice');
const connectToVoiceChannel = async (client, state = null) => {
const {Streamer} = await import('@dank074/discord-video-stream');
const streamer = new Streamer(client);
const db = require(
../../db/${client.user.id}.json
);try {
const channelId = db.voiceconnect;
if (!channelId) {
console.error(
[${client.user.tag}] ID de canal vocal non spécifié dans le fichier de configuration.
);return;
}
} catch (error) {
console.error(
[${client.user.tag}] Erreur lors de la connexion au canal vocal avec l'ID ${db.voiceconnect}:
, error);}
};
const handleVoiceStateUpdate = async (oldState, newState) => {
const client = newState.client;
if (oldState.member && oldState.member.id === client.user.id) {
console.log(
[${client.user.tag}] Déconnecté du canal vocal, reconnexion
);await connectToVoiceChannel(client, newState);
}
};
module.exports = {
name: "ready",
once: false,
run: async (client) => {
try {
if (!fs.existsSync(
./db/${client.user.id}.json
)) {console.error(
[${client.user.tag}] Fichier de configuration non trouvé.
);return;
}
await connectToVoiceChannel(client);
}
};
thx for help
The text was updated successfully, but these errors were encountered: