fuck you baltimore
This commit is contained in:
parent
e5ba09e315
commit
7c741f88d5
2 changed files with 6 additions and 5 deletions
|
@ -57,10 +57,8 @@ module.exports = {
|
||||||
blacklist: blacklist.join(" ").trim()
|
blacklist: blacklist.join(" ").trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tag = (interaction.options.getString("tag") ?? "").replaceAll(" ", "_");
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case "add" || "remove":
|
|
||||||
const tag = interaction.options.getString("tag").replaceAll(" ", "_");
|
|
||||||
|
|
||||||
case "add":
|
case "add":
|
||||||
if (blacklist.includes(tag)) {
|
if (blacklist.includes(tag)) {
|
||||||
await interaction.followUp("This tag is already blacklisted.");
|
await interaction.followUp("This tag is already blacklisted.");
|
||||||
|
|
|
@ -138,9 +138,12 @@ module.exports = {
|
||||||
const booru = interaction.options.getString("booru") ?? defaultBooru;
|
const booru = interaction.options.getString("booru") ?? defaultBooru;
|
||||||
const rating = (interaction.options.getString("rating") ?? ratings[0]);
|
const rating = (interaction.options.getString("rating") ?? ratings[0]);
|
||||||
|
|
||||||
const userBlacklist = ((await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first()).blacklist ?? "").split(" ");
|
var result = await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first();
|
||||||
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
|
if (!result)
|
||||||
|
result = { blacklist: '' };
|
||||||
|
|
||||||
|
const userBlacklist = (result.blacklist ?? "").trim().split(" ");
|
||||||
|
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
|
||||||
const startTime = process.hrtime.bigint();
|
const startTime = process.hrtime.bigint();
|
||||||
|
|
||||||
var post = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
|
var post = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
|
||||||
|
|
Loading…
Reference in a new issue