From 09eee1a0cada40b5ede644b43bccab5de835a852 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 18 Jun 2025 00:36:32 +0200 Subject: [PATCH 1/2] Add support for prepending URL with '<' and appending with '>' --- commands/misc/dl.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/misc/dl.js b/commands/misc/dl.js index 3752e59..86c2d1a 100644 --- a/commands/misc/dl.js +++ b/commands/misc/dl.js @@ -16,6 +16,9 @@ module.exports = { let url; if(args.length > 0){ + if(args[0].charAt(0) === '<' && args[0].charAt(args[0].length - 1) === '>'){ + args[0] = args[0].slice(0, args[0].length - 1) + } try { url = new URL(args[0]); url = url.href; From 40052ac85d86120c9329b51b8c46164ce501dd40 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 18 Jun 2025 00:37:03 +0200 Subject: [PATCH 2/2] Improve error messages --- commands/misc/dl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/misc/dl.js b/commands/misc/dl.js index 86c2d1a..d86077f 100644 --- a/commands/misc/dl.js +++ b/commands/misc/dl.js @@ -24,16 +24,16 @@ module.exports = { url = url.href; } catch (error) { this.cleanUp(downloadsDir); - message.channel.send("Invalid URL"); + message.channel.send("Could not parse the provided argument as a URL."); return; } } else { this.cleanUp(downloadsDir); - return message.channel.send("No url provided") + return message.channel.send("You have to provide a URL in an argument.") } if(this.executeCommand(`yt-dlp "${url}" -P ${downloadsDir} --cookies ${cookieFilepath}`).error){ - message.channel.send("An error occured when executing the command"); + message.channel.send("An error occured when downloading the video."); this.cleanUp(downloadsDir); return; }