Update play function

This commit is contained in:
Christer Warén 2022-04-06 22:47:01 +03:00
parent 3654dd58ba
commit bf7336ae8d

View File

@ -57,13 +57,13 @@ module.exports = async function play(client, interaction, guild, station) {
);
if(!radio.message){
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
radio.message = await radio.textChannel?.send({ embeds: [embed], components: [buttons] });
} else {
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] });
radio.message = await radio.textChannel?.send({ embeds: [embed], components: [buttons] });
}
}