summaryrefslogtreecommitdiffstats
path: root/src/api/e926
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-10-20 09:28:31 +0200
committerVolpeon <git@volpeon.ink>2021-10-20 09:28:31 +0200
commit34d6aa385807bce63c88ca0176190317aea343ba (patch)
tree26d2b11866f46e8952f45a39f234ac121df3992d /src/api/e926
parentKeep 100 items in dedupe db (diff)
downloadferalbot-34d6aa385807bce63c88ca0176190317aea343ba.tar.gz
feralbot-34d6aa385807bce63c88ca0176190317aea343ba.tar.bz2
feralbot-34d6aa385807bce63c88ca0176190317aea343ba.zip
Added post id blacklist
Diffstat (limited to 'src/api/e926')
-rw-r--r--src/api/e926/index.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/api/e926/index.ts b/src/api/e926/index.ts
index 37d8598..8e363c9 100644
--- a/src/api/e926/index.ts
+++ b/src/api/e926/index.ts
@@ -71,6 +71,11 @@ export async function getRandomPost(query: GetPostQuery): Promise<Post> {
71 const postIndex = Math.floor(Math.random() * response.posts.length); 71 const postIndex = Math.floor(Math.random() * response.posts.length);
72 const post = response.posts[postIndex]; 72 const post = response.posts[postIndex];
73 73
74 if (config.e621.blacklist.includes(post.id)) {
75 await delay(1000);
76 return getRandomPost(query);
77 }
78
74 const isDupe = await dedupeDb.insertIfNotExists({ provider: "e926", id: post.id }); 79 const isDupe = await dedupeDb.insertIfNotExists({ provider: "e926", id: post.id });
75 80
76 if (isDupe) { 81 if (isDupe) {