This commit is contained in:
Ashley Graves 2024-10-12 00:51:54 +02:00
parent a9cf2be98b
commit 45590a74cb

View file

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