8go / matrix-commander

simple but convenient CLI-based Matrix client app for sending and receiving
GNU General Public License v3.0
563 stars 59 forks source link

Feature request/PR proposal: Support for emojis in messages #130

Closed jonathandmoore closed 1 year ago

jonathandmoore commented 1 year ago

Emoji short codes (e.g. :collision:) in messages do not seem to be interpreted in the natural way (at least in the Element client).

e.g.. this:

matrix-commander -m 'testing testing :collision:' 

matrix-commander -m 'testing testing :collision:'

I would expect the emoji short code to be replaced by the explosion/collision emoji character, as it is in this github markdown interface. In Element, this does not happen with a message received from matrix-commander, regardless of whether the --markdown flag is used or not.

UPDATE: I figured out you can craft emojis with unicode characters in a message submitted as HTML. Would it make sense to add this as an example to the examples script, so that at least people can find out how to initiate emojis in their messages from matrix-commander?

matrix-commander -m 'testing testing 💥  ' --html

I still like the idea of interpreting the shortcodes in e.g. markdown mode.

jonathandmoore commented 1 year ago

I have made a clone of matrix-commander with a branch that imports the package emoji and adds a -j --emojize flag if you are interested in a PR for that. It will convert strings in the message like :collision: to :collision: characters.

8go commented 1 year ago

Excellent :clap: :clap:

8go commented 1 year ago

Example:

For a list of emojis look at: https://unicode.org/emoji/charts/full-emoji-list.html

Note that you have to use Unicode emoji names, NOT Github emoji names!

Bad Examples, this will NOT work: