feat: add validation to prevent both PDF file and URL being provided simultaneously

This commit is contained in:
ɧσℓσ
2025-12-10 20:20:08 +01:00
parent 9d2c4170d2
commit 7e958db51c

View File

@@ -26,6 +26,11 @@ class PdfHandler {
const urlOption = interaction.options.getString('url');
const isPublic = interaction.options.getBoolean('public') === true;
if (attachment && urlOption) {
await interaction.editReply({ content: '❌ Fournis soit un fichier PDF, soit une URL, mais pas les deux.' });
return;
}
const sourceUrl = attachment ? attachment.url : urlOption;
if (!attachment && !urlOption) {
await interaction.editReply({ content: '❌ Fournis un PDF (fichier) ou une URL https:// vers un PDF.' });