1
0
Fork 0

m->d move reply message preview to own line

This commit is contained in:
Cadence Ember 2023-08-27 23:25:08 +12:00
parent 1ed40bb5f4
commit 6a03c96984
4 changed files with 32 additions and 10 deletions

View file

@ -173,9 +173,9 @@ async function eventToMessage(event, guild, di) {
replyLine += `Ⓜ️**${senderName}**: `
}
const repliedToContent = repliedToEvent.content.formatted_body || repliedToEvent.content.body
const contentPreviewChunks = chunk(repliedToContent.replace(/.*<\/mx-reply>/, "").replace(/(?:\n|<br>)+/g, " ").replace(/<[^>]+>/g, ""), 24)
const contentPreviewChunks = chunk(repliedToContent.replace(/.*<\/mx-reply>/, "").replace(/(?:\n|<br>)+/g, " ").replace(/<[^>]+>/g, ""), 50)
const contentPreview = contentPreviewChunks.length > 1 ? contentPreviewChunks[0] + "..." : contentPreviewChunks[0]
replyLine += contentPreview + "\n"
replyLine = `> ${replyLine}\n> ${contentPreview}\n`
})()
// Handling mentions of Discord users