Don't crash when using advanced a second time

This commit is contained in:
Supositware 2022-06-16 10:25:45 +02:00
parent 321c584b96
commit 4ae559097c

View file

@ -67,7 +67,7 @@ module.exports = {
await interaction.deleteReply(); await interaction.deleteReply();
await interaction.followUp({ content: 'Which quality do you want?', ephemeral: true, components: [row] }); await interaction.followUp({ content: 'Which quality do you want?', ephemeral: true, components: [row] });
interaction.client.on('interactionCreate', async (interactionMenu) => { interaction.client.once('interactionCreate', async (interactionMenu) => {
if (!interactionMenu.isSelectMenu()) return; if (!interactionMenu.isSelectMenu()) return;
if (interactionMenu.customId === 'downloadQuality') { if (interactionMenu.customId === 'downloadQuality') {
await interactionMenu.deferReply({ ephemeral: false }); await interactionMenu.deferReply({ ephemeral: false });
@ -120,6 +120,7 @@ async function download(url, interaction) {
await interaction.deleteReply(); await interaction.deleteReply();
await interaction.followUp({ content: 'Uh oh! An error has occured!', ephemeral: true }); await interaction.followUp({ content: 'Uh oh! An error has occured!', ephemeral: true });
}); });
return;
} }
async function downloadVideo(url, output, format) { async function downloadVideo(url, output, format) {