This commit is contained in:
Ashley Graves 2024-10-10 11:19:49 +02:00
parent 43a3fe4c25
commit e16f5ecd5c

View file

@ -111,13 +111,13 @@ module.exports = {
const nsfw = interaction.options.getBoolean("nsfw") ?? false;
await interaction.reply("Searching, please wait...");
tags = [...(nsfw ? [] : ["-rating:explicit", "-rating:questionable"]), ...tags];
const searchTags = [...(nsfw ? [] : ["-rating:explicit", "-rating:questionable"]), ...tags];
const startTime = process.hrtime.bigint();
var post = null;
while (post == null) {
var newPost = (await Booru.search(booru, tags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
var newPost = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
if (newPost == null) {
await interaction.editReply("Could not find any post matching tags.");
return;