fuck you baltimore

This commit is contained in:
Ashley Graves 2024-10-10 21:51:41 +02:00
parent e5ba09e315
commit 7c741f88d5
2 changed files with 6 additions and 5 deletions

View file

@ -57,10 +57,8 @@ module.exports = {
blacklist: blacklist.join(" ").trim()
}
const tag = (interaction.options.getString("tag") ?? "").replaceAll(" ", "_");
switch (command) {
case "add" || "remove":
const tag = interaction.options.getString("tag").replaceAll(" ", "_");
case "add":
if (blacklist.includes(tag)) {
await interaction.followUp("This tag is already blacklisted.");

View file

@ -138,9 +138,12 @@ module.exports = {
const booru = interaction.options.getString("booru") ?? defaultBooru;
const rating = (interaction.options.getString("rating") ?? ratings[0]);
const userBlacklist = ((await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first()).blacklist ?? "").split(" ");
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
var result = await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first();
if (!result)
result = { blacklist: '' };
const userBlacklist = (result.blacklist ?? "").trim().split(" ");
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
const startTime = process.hrtime.bigint();
var post = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];