Fixed memory leak even more
This commit is contained in:
parent
e80ba096c8
commit
2283010ee3
@ -81,7 +81,15 @@ module.exports = (mes, komand, celArgs) => {
|
|||||||
|
|
||||||
channel.join()
|
channel.join()
|
||||||
.then(con => {
|
.then(con => {
|
||||||
if (!timeouty[mes.guild.id]) vypocitatCas(con);
|
if (!timeouty[mes.guild.id]) {
|
||||||
|
vypocitatCas(con);
|
||||||
|
con.on('disconnect', () => {
|
||||||
|
if (timeouty[mes.guild.id]) {
|
||||||
|
clearTimeout(timeouty[mes.guild.id]);
|
||||||
|
delete timeouty[mes.guild.id];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
con.play('./zvuky/nazdar.ogg');
|
con.play('./zvuky/nazdar.ogg');
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -103,8 +111,6 @@ module.exports = (mes, komand, celArgs) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vojs.channel.leave();
|
vojs.channel.leave();
|
||||||
clearTimeout(timeouty[mes.guild.id]);
|
|
||||||
delete timeouty[mes.guild.id];
|
|
||||||
mes.react('purfieRIP:644609482843881483');
|
mes.react('purfieRIP:644609482843881483');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user