Allow choosing multiple formats

This commit is contained in:
supositware 2022-06-16 14:36:38 +02:00
parent 3dad025bb6
commit 14ee901846

View file

@ -61,6 +61,8 @@ module.exports = {
new MessageSelectMenu() new MessageSelectMenu()
.setCustomId('downloadQuality') .setCustomId('downloadQuality')
.setPlaceholder('Nothing selected') .setPlaceholder('Nothing selected')
.setMinValues(1)
.setMaxValues(2)
.addOptions(options), .addOptions(options),
); );
@ -89,6 +91,7 @@ async function download(url, interaction) {
if (interaction.customId === 'downloadQuality') { if (interaction.customId === 'downloadQuality') {
format = interaction.values[0]; format = interaction.values[0];
if (interaction.values[1]) format += '+' + interaction.values[1];
} }
downloadVideo(url, interaction.id, format) downloadVideo(url, interaction.id, format)