forked from cadence/out-of-your-element
d->m bridge emojis in messages
This commit is contained in:
parent
94c4b6a262
commit
1657de4eef
5 changed files with 104 additions and 4 deletions
|
@ -41,8 +41,12 @@ function getDiscordParseCallbacks(message, useHTML) {
|
|||
/** @param {{animated: boolean, name: string, id: string, type: "discordEmoji"}} node */
|
||||
emoji: node => {
|
||||
if (useHTML) {
|
||||
// TODO: upload the emoji and actually use the right mxc!!
|
||||
return `<img src="mxc://cadence.moe/${node.id}" data-mx-emoticon alt=":${node.name}:" title=":${node.name}:" height="24">`
|
||||
const mxc = select("emoji", "mxc_url", "WHERE emoji_id = ?").pluck().get(node.id)
|
||||
if (mxc) {
|
||||
return `<img data-mx-emoticon height="32" src="${mxc}" title=":${node.name}:" alt=":${node.name}:">`
|
||||
} else {
|
||||
return `<img src="mxc://cadence.moe/${node.id}" data-mx-emoticon alt=":${node.name}:" title=":${node.name}:" height="24">`
|
||||
}
|
||||
} else {
|
||||
return `:${node.name}:`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue