guh
This commit is contained in:
parent
307410e1d2
commit
80a0e85af3
1 changed files with 5 additions and 1 deletions
|
@ -147,7 +147,11 @@ module.exports = {
|
||||||
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
|
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 tries = 0;
|
||||||
|
var post;
|
||||||
|
while (post.length == 0 && (tries++) < 5)
|
||||||
|
post = await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null });
|
||||||
|
|
||||||
if (post == null) {
|
if (post == null) {
|
||||||
await interaction.followUp(emojis.warning + " Could not find any post matching tags.");
|
await interaction.followUp(emojis.warning + " Could not find any post matching tags.");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue