Convert emojihax to real emoji

This commit is contained in:
Cadence Ember
2026-02-13 20:27:38 +13:00
parent 676cab0dc8
commit 5002f3046a
4 changed files with 50 additions and 1 deletions
+5
View File
@@ -757,6 +757,11 @@ async function messageToEvent(message, guild, options = {}, di) {
}
}
// Scan the content for emojihax and replace them with real emojis
content = content.replaceAll(/\[([a-zA-Z0-9_-]{2,32})(?:~[0-9]+)?\]\(https:\/\/cdn\.discordapp\.com\/emojis\/([0-9]+)\.[^ \n)`]+\)/g, (_, name, id) => {
return `<:${name}:${id}>`
})
const {body, html} = await transformContent(content)
await addTextEvent(body, html, msgtype)
}