This commit is contained in:
Ashley Graves 2024-10-16 00:42:48 +02:00
parent 54a310fb3d
commit a85c33a1b5

View file

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