mautrix / discord

A Matrix-Discord puppeting bridge
https://go.mau.fi/mautrix-discord
GNU Affero General Public License v3.0
240 stars 22 forks source link

Custom Matrix emoji to Discord (<img> in formatted_body) #145

Open North-West-Wind opened 1 month ago

North-West-Wind commented 1 month ago

Some clients (Cinny, FluffyChat) support custom emojis. These emojis are sent as <img data-mx-emoticon> with a mxc:// for src. If a message only contains these custom emojis, the bridge reports that the message is empty.

Will it possible to send this as a custom emoji, or at least send it as a small image (sort of like Freemoji plugin for BetterDiscord)?

This is an example on Cinny: Screenshot_2024-06-01-20-28-49-950_org mozilla fenix-edit

Source code of message:

{
  "type": "m.room.message",
  "sender": "@northwestwind:matrix.northwestw.in",
  "content": {
    "msgtype": "m.text",
    "body": ":yay:",
    "format": "org.matrix.custom.html",
    "formatted_body": "<img data-mx-emoticon src=\"mxc://matrix.northwestw.in/RxXgxwJZWMtkCHeLLorjvgDo\" alt=\"yay\" title=\"yay\" height=\"32\" />"
  },
  "origin_server_ts": 1717244354035,
  "unsigned": {
    "age": 52,
    "transaction_id": "m1717244353402.2"
  },
  "event_id": "$s7C-XjMNF-LGIq0cbQ7S5mlao-ktS5kdQAy1WWqZHrg",
  "room_id": "!CNKIOxQxymmMmNJjeo:matrix.org"
}