Add dtext to markdown for tickets and appeals

This commit is contained in:
Tarrgon
2026-06-03 08:01:59 -04:00
parent 5e5840ffdf
commit bafed23169
5 changed files with 103 additions and 4 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import { APIEmbedField, EmbedAuthorOptions } from 'discord.js';
import { config } from '../config';
import { getE621Post, PostAction, spoilerOrBlacklist } from './e621-utils';
import { appealIDRegex, blipIDRegex, commentIDRegex, flagIDRegex, forumTopicIDRegex, poolIDRegex, postIDRegex, recordIDRegex, searchLinkRegex, setIDRegex, takedownIDRegex, ticketIDRegex, userIDRegex, wikiLinkRegex } from './message-matcher-regex';
import { dtextToMarkdown } from './dtext-utils';
// TODO: Condense this and the message event handler regex array.
const linkReplacers = [
@@ -134,7 +135,7 @@ export async function getLinks(input: string, limit: number = Number.MAX_SAFE_IN
}
export async function getDescription(data: { reason: string }): Promise<string> {
return data.reason.length <= MAX_DESCRIPTION_LENGTH ? await getLinks(data.reason) : await getLinks(data.reason, MAX_DESCRIPTION_LENGTH);
return dtextToMarkdown(data.reason.length <= MAX_DESCRIPTION_LENGTH ? await getLinks(data.reason) : await getLinks(data.reason, MAX_DESCRIPTION_LENGTH));
}
export function getAuthor(data: { user_id: number, user: string }): EmbedAuthorOptions {