Spoiler other default blacklist posts

This commit is contained in:
Tarrgon
2025-06-05 13:02:59 -04:00
parent acf27a8bd2
commit e71db2f74f
3 changed files with 28 additions and 11 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { createClient } from '@redis/client';
import { Database } from './Database';
import { config } from '../config';
import { APIEmbedField, Client, EmbedAuthorOptions, EmbedBuilder, SendableChannels, TextBasedChannel } from 'discord.js';
import { blipIDRegex, commentIDRegex, forumTopicIDRegex, humanizeCapitalization, poolIDRegex, postIDRegex, shouldAlert, recordIDRegex, searchLinkRegex, setIDRegex, takedownIDRegex, ticketIDRegex, userIDRegex, wikiLinkRegex, getE621Post, hasBlacklistedTags } from '../utils';
import { blipIDRegex, commentIDRegex, forumTopicIDRegex, humanizeCapitalization, poolIDRegex, postIDRegex, shouldAlert, recordIDRegex, searchLinkRegex, setIDRegex, takedownIDRegex, ticketIDRegex, userIDRegex, wikiLinkRegex, getE621Post, spoilerOrBlacklist, PostAction } from '../utils';
import { BanUpdate, Ticket, TicketPhrase, TicketUpdate } from '../types';
// TODO: Condense this and the message event handler regex array.
@@ -32,7 +32,7 @@ const linkReplacers = [
tester: async (postId: string, before: string, after: string) => {
const post = await getE621Post(postId);
if (!post) return { allowed: true, before, after };
const allowed = !hasBlacklistedTags(post);
const allowed = spoilerOrBlacklist(post).action != PostAction.Blacklist;
return { allowed, before, after };
},