From 79ab38f8f0a79aaf752a15521f47404ed202d0c6 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Wed, 16 Oct 2024 20:44:17 +0200 Subject: [PATCH] guh --- src/commands/utility/file.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/utility/file.js b/src/commands/utility/file.js index 5d5ef25..3e5cfe2 100644 --- a/src/commands/utility/file.js +++ b/src/commands/utility/file.js @@ -35,7 +35,8 @@ function shorten(str) { var urlStart = str.indexOf("://") + 3; if (urlStart == 2) urlStart = 0; - return str.length <= len ? str : `[${str.slice(urlStart, urlStart + (len - 3))}...](${str.startsWith("magnet:") ? (`${process.env.BASE_URL}/magnet/${str}`) : str})`; + + return str.length <= len ? str : `[${str.slice(urlStart, urlStart + (len - 3))}...](${(str.startsWith("magnet:") ? (`${process.env.BASE_URL}/magnet/${str}`) : str).replaceAll(" ", "%20")})`; } const emojis = JSON.parse(readFileSync("config/emojis.json")); @@ -97,4 +98,4 @@ module.exports = { }); pagination.render(); } -} \ No newline at end of file +}