diff --git a/src/commands/utility/file.js b/src/commands/utility/file.js index 606e564..9e8f95a 100644 --- a/src/commands/utility/file.js +++ b/src/commands/utility/file.js @@ -43,28 +43,29 @@ module.exports = { const embeds = []; const data = await (await fetch(`${process.env.SEARXNG_INSTANCE}/search?${queryString}`)).json(); for (const result of data.results) { - if (result.magnetlink) result.magnetlink = `[magnet](${process.env.BASE_URL}/magnet/${result.magnetlink})`; + if (result.magnetlink) + result.magnetlink = `[${result.magnetlink.slice(0, result.magnetlink.indexOf("&"))}](${process.env.BASE_URL}/magnet/${result.magnetlink})`; + + if (result.publishedDate) + result.publishedDate = new Date(result.publishedDate).toLocaleDateString('en-us', { weekday: "long", year: "numeric", month: "short", day: "numeric" }); const footerText = ([ result.filesize, `${result.seed} S`, `${result.leech} L`, - result.publishedDate ? new Date(result.publishedDate).toLocaleDateString('en-us', { weekday: "long", year: "numeric", month: "short", day: "numeric" }) : '' + result.publishedDate ]).filter(notEmpty).join(" • "); - const site = result.parsed_url.slice(0, 2).join("://"); - - const description = [ - "Downloads:", + const description = "• " + [ result.magnetlink, result.torrentfile, result.url - ].filter(notEmpty).join("\n"); + ].filter(notEmpty).join("\n• "); const embed = new EmbedBuilder() .setAuthor({ name: result.engine, - iconURL: `https://vault.incest.world/icons/${result.parsed_url[1]}/icon.png` + url: result.parsed_url.slice(0, 2).join("://") }) .setTitle(result.title) .setURL(result.url)