This commit is contained in:
Ashley Graves 2024-10-10 15:41:50 +02:00
parent 9f7275269f
commit 99079bcc7d

View file

@ -134,16 +134,11 @@ module.exports = {
const startTime = process.hrtime.bigint(); const startTime = process.hrtime.bigint();
var post = null; var post = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
while (post == null) { if (post == null) {
var newPost = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0];
if (newPost == null) {
await interaction.followUp("<:warning:1293874152150667315> Could not find any post matching tags."); await interaction.followUp("<:warning:1293874152150667315> Could not find any post matching tags.");
return; return;
} }
if (/*!nsfw && isNSFWPost(newPost) || */isAIPost(newPost) || isFucked(newPost)) continue;
post = newPost;
}
const endTime = process.hrtime.bigint(); const endTime = process.hrtime.bigint();
const timeTaken = endTime - startTime; const timeTaken = endTime - startTime;