Added radio.message?.delete in voiceStateUpdate

This commit is contained in:
Christer Warén 2021-09-01 12:51:17 +03:00
parent 6ed91fe43b
commit a1aa96fc2f

View File

@ -17,6 +17,7 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
return client.radio.delete(newState.guild.id); return client.radio.delete(newState.guild.id);
} }
@ -39,6 +40,7 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.radio.delete(oldState.guild.id); client.radio.delete(oldState.guild.id);
} }
@ -58,6 +60,7 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.radio.delete(newState.guild.id); client.radio.delete(newState.guild.id);
} }