Update play command

This commit is contained in:
Christer Warén 2021-09-11 18:27:21 +03:00
parent 9019741146
commit 1cfa62802f

View File

@ -60,7 +60,12 @@ module.exports = async function play(client, interaction, guild, station) {
if(!radio.message){ if(!radio.message){
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] }); radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
} else { } else {
radio.message.edit({ embeds: [embed], components: [buttons] }); if(radio.textChannel.id == radio.message.channel.id){
radio.message.edit({ embeds: [embed], components: [buttons] });
} else {
radio.message?.delete();
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
}
} }
message.play = client.messages.play.replace("%radio.station.name%", radio.station.name); message.play = client.messages.play.replace("%radio.station.name%", radio.station.name);