finally fixed dumb joinvoice error
This commit is contained in:
parent
dc7c70d0c0
commit
026991d469
@ -31,7 +31,7 @@ const exp: Modul = {
|
|||||||
if (verze == require("../../package.json").version) return `ale ja se nemam co priucit vole kkte ${mes.author}`;
|
if (verze == require("../../package.json").version) return `ale ja se nemam co priucit vole kkte ${mes.author}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
getVoiceConnections().forEach(con => con.disconnect());
|
getVoiceConnections().forEach(con => con.destroy());
|
||||||
const client: Client = module.exports.client;
|
const client: Client = module.exports.client;
|
||||||
client.user?.setStatus("invisible");
|
client.user?.setStatus("invisible");
|
||||||
mes.react("👋")
|
mes.react("👋")
|
||||||
@ -62,7 +62,7 @@ const exp: Modul = {
|
|||||||
} else if (!spim) {
|
} else if (!spim) {
|
||||||
if (cont == `${prefix} vypni se`) {
|
if (cont == `${prefix} vypni se`) {
|
||||||
mes.react(emouty.purfieRIP);
|
mes.react(emouty.purfieRIP);
|
||||||
getVoiceConnections().forEach(con => con.disconnect());
|
getVoiceConnections().forEach(con => con.destroy());
|
||||||
mes.client.user?.setStatus("invisible");
|
mes.client.user?.setStatus("invisible");
|
||||||
spim = true;
|
spim = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,20 +73,8 @@ export async function joinVoice(channel: VoiceChannel | StageChannel | string, g
|
|||||||
let conn = getVoiceConnection(guildId);
|
let conn = getVoiceConnection(guildId);
|
||||||
let prev: boolean | string = false;
|
let prev: boolean | string = false;
|
||||||
if (conn) {
|
if (conn) {
|
||||||
if (conn.joinConfig.channelId === channelId) {
|
if (conn.joinConfig.channelId == channelId) return { conn, prev: true };
|
||||||
await entersState(conn, VoiceConnectionStatus.Ready, 3e4)
|
prev = conn.joinConfig.channelId ?? false;
|
||||||
.catch(err => {
|
|
||||||
conn!.destroy();
|
|
||||||
log("pri pripojovani do vojsu nastala chyba:");
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
return { conn, prev: true };
|
|
||||||
}
|
|
||||||
prev = conn.joinConfig.channelId!;
|
|
||||||
if (!prev) {
|
|
||||||
log(new Error(`chci do kanelu "${channelId}", na serveru "${guildId}" a config channelid nen`));
|
|
||||||
throw new Error("Dement no");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = joinVoiceChannel({
|
conn = joinVoiceChannel({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user