Add dtext to markdown for tickets and appeals
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user