neodposlouchavej!1!!!1!1!!!1!
This commit is contained in:
parent
cb35c0226b
commit
11c7c0551d
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
denim3001 - origo
|
denim3001 - origo
|
||||||
nahravky
|
nahravky
|
||||||
|
zvuky/placeholder.ogg
|
||||||
|
|||||||
29
app.js
29
app.js
@ -46,5 +46,32 @@ client.on('presenceUpdate', (bef, aft) => {
|
|||||||
console.log(`${aft.user.username} změnil status z ${bef.status} na ${aft.status}`);
|
console.log(`${aft.user.username} změnil status z ${bef.status} na ${aft.status}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(process.env.TOKEN);
|
client.on('voiceStateUpdate', (bef, aft) => {
|
||||||
|
if (!aft.channel || !aft.guild.voice || aft.member.user === client.user) return;
|
||||||
|
|
||||||
|
// const vysvetleni = (user, vojs = undefined) => {
|
||||||
|
// const con = aft.guild.voice.connection;
|
||||||
|
// const disp = con.play('./zvuky/neodposlouchavej.ogg');
|
||||||
|
// disp.on('finish', () => {
|
||||||
|
// user.setDeaf(true, 'otposlouchávala ta gadza');
|
||||||
|
// if (vojs) con.voice.setChannel(vojs);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (aft.mute && !aft.deaf) {
|
||||||
|
// if (aft.guild.voice.channel !== aft.channel) {
|
||||||
|
// const vojsBack = aft.guild.voice.channel;
|
||||||
|
// aft.guild.voice.setChannel(aft.channel)
|
||||||
|
// .then(() => vysvetleni(aft, vojsBack));
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// vysvetleni(aft);
|
||||||
|
const disp = aft.guild.voice.connection.play('./zvuky/neodposlouchavej.ogg');
|
||||||
|
disp.on('finish', () => user.setDeaf(true, 'otposlouchávala ta gadza'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bef.channel) return;
|
||||||
|
if (bef.mute && bef.deaf && !aft.mute && aft.deaf) aft.setDeaf(false, 'us muze poslouchat gaza');
|
||||||
|
});
|
||||||
|
|
||||||
|
client.login(process.env.TOKEN);
|
||||||
|
|||||||
BIN
zvuky/neodposlouchavej.ogg
Normal file
BIN
zvuky/neodposlouchavej.ogg
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user