if vojs potichu, nazdar not played
This commit is contained in:
parent
e2b8ffe039
commit
2ad65d54ff
@ -67,20 +67,21 @@ module.exports = {
|
||||
const channel = mes.member?.voice.channel;
|
||||
if (!channel) return `di si tam sam ne ty gadzo ${mes.author}`;
|
||||
|
||||
if (arg !== "potichu") mes.channel.send("<@&591306633196339261> vojs");
|
||||
const nahlas = arg !== "potichu";
|
||||
if (nahlas) mes.channel.send("<@&591306633196339261> vojs");
|
||||
|
||||
joinVoice(channel)
|
||||
.then(obj => {
|
||||
const conn = obj.conn;
|
||||
const { prev, conn } = obj;
|
||||
if (!timeouty[mes.guildId!]) {
|
||||
vypocitatCas(conn);
|
||||
conn.on(VoiceConnectionStatus.Disconnected, () => conn.destroy());
|
||||
conn.on(VoiceConnectionStatus.Destroyed, () => {
|
||||
conn.on("stateChange", (_, now) => {
|
||||
if (now.status !== VoiceConnectionStatus.Disconnected && now.status !== VoiceConnectionStatus.Destroyed) return;
|
||||
clearTimeout(timeouty[mes.guildId!]);
|
||||
delete timeouty[mes.guildId!];
|
||||
});
|
||||
}
|
||||
play(conn, "zvuky/nazdar.ogg");
|
||||
if (prev !== true && nahlas) play(conn, "zvuky/nazdar.ogg");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user