From e20e7d74c60baa3fd54642170aa0a9c5dc4b1a48 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Wed, 16 Oct 2024 01:26:41 +0200 Subject: [PATCH] nice --- src/commands/utility/file.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/utility/file.js b/src/commands/utility/file.js index 119e11f..6e07e43 100644 --- a/src/commands/utility/file.js +++ b/src/commands/utility/file.js @@ -26,6 +26,10 @@ function notEmpty(str) { return str && str.trim() !== '' } +function shorten(str) { + return str.length <= 20 ? str : str.slice(0, 17) + "..."; +} + const emojis = JSON.parse(readFileSync("config/emojis.json")); module.exports = { @@ -61,7 +65,7 @@ module.exports = { result.magnetlink, result.torrentfile, result.url - ].filter(notEmpty).join("\n• "); + ].filter(notEmpty).map(shorten).join("\n• "); const embed = new EmbedBuilder() .setAuthor({