This commit is contained in:
Ashley Graves 2024-10-16 20:44:17 +02:00
parent 9105c3563e
commit 79ab38f8f0

View file

@ -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"));