1
0
Fork 0

Include fallback text for replies to media

This commit is contained in:
Cadence Ember 2023-07-12 14:33:38 +12:00
parent 011f9c5ecb
commit f4bfe54850

View file

@ -144,7 +144,9 @@ async function messageToEvent(message, guild, api) {
repliedToDisplayName = message.referenced_message?.author.global_name || message.referenced_message?.author.username || "a Discord user" repliedToDisplayName = message.referenced_message?.author.global_name || message.referenced_message?.author.username || "a Discord user"
repliedToUserHtml = repliedToDisplayName repliedToUserHtml = repliedToDisplayName
} }
const repliedToContent = message.referenced_message?.content || "[Replied-to message content wasn't provided by Discord]" let repliedToContent = message.referenced_message?.content
if (repliedToContent == "") repliedToContent = "[Media]"
else if (!repliedToContent) repliedToContent = "[Replied-to message content wasn't provided by Discord]"
const repliedToHtml = markdown.toHTML(repliedToContent, { const repliedToHtml = markdown.toHTML(repliedToContent, {
discordCallback: getDiscordParseCallbacks(message, true) discordCallback: getDiscordParseCallbacks(message, true)
}, null, null) }, null, null)