trigger cleanUp() only if it was from a message

This commit is contained in:
Supositware 2022-09-10 10:53:21 +02:00
parent d4a56009fd
commit c4574e47f6

View file

@ -161,7 +161,7 @@ async function download(url, interaction, originalInteraction) {
if (interactionMenu.customId === 'preset') {
await interactionMenu.deferReply({ ephemeral: false });
compress(file, interactionMenu, Embed);
cleanUp();
if (interaction.isMessage) cleanUp();
}
});
return;
@ -182,7 +182,7 @@ async function download(url, interaction, originalInteraction) {
else {
await interaction.editReply({ embeds: [Embed], files: [output], ephemeral: false });
}
cleanUp();
if (interaction.isMessage) cleanUp();
})
.catch(async err => {
console.error(err);