From 45590a74cba05e6dd5da2369c95e6ed9f33dacf3 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Sat, 12 Oct 2024 00:51:54 +0200 Subject: [PATCH] g --- src/commands/fun/gelbooru.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/fun/gelbooru.js b/src/commands/fun/gelbooru.js index 77ef2f2..877d0b8 100644 --- a/src/commands/fun/gelbooru.js +++ b/src/commands/fun/gelbooru.js @@ -124,14 +124,13 @@ module.exports = { const tags = (interaction.options.getString("tags") ?? "").split(" "); const booru = interaction.options.getString("booru") ?? defaultBooru; - const rating = (interaction.options.getString("rating") ?? ratings[0]); var result = await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first(); if (!result) result = { blacklist: '' }; const userBlacklist = (result.blacklist ?? "").trim().split(" ").filter(notEmpty); - const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)]; + const searchTags = [...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)]; const startTime = process.hrtime.bigint(); var tries = 0; @@ -148,6 +147,9 @@ module.exports = { const endTime = process.hrtime.bigint(); const timeTaken = endTime - startTime; + if (post.booru.domain == "gelbooru.com" && post.rating == "s") + post.rating = "q"; + const fileName = (post.rating != "g" ? "SPOILER_" : "") + basename(post.fileUrl); const ext = extname(fileName).toLowerCase();