[SOLVED] Is there a way to customize default emojis?

I notice this issue/feature still hasn’t been solved/implemented, so I thought I’d share the hack I’m using for the moment, in case others find it useful too.

My Mattermost installation is located at /var/www/mattermost, and inside that is a client/emoji folder with one PNG file for each image. So if I replace each of those images with one of my choice, they’ll get replaced in the Mattermost frontend. (Of course, I’m not sure what’ll happen during an update; one may need to repeat the process again).

Replacing each PNG file with an icon of my choice is tedious, but luckily Google’s Noto Emoji repo includes pre-generated icons. So here’s what I did to replace Mattemost’s default emoji with the Noto ones:

  1. Clone the Noto Emoji repo: git clone https://github.com/googlefonts/noto-emoji
  2. Move Mattermost’s default emoji directory to a backup location: sudo mv -i /var/www/mattermost/client/emoji /var/www/mattermost/client/emoji.bak
  3. Copy over Noto’s emoji. We’re using the 72x72 versions since the 64x64 size that Mattermost uses by default isn’t available. Note that we are copying the 72 folder, and renaming it to emoji in the process: sudo cp -i noto-emoji/png/72 /var/www/mattermost/client/emoji
  4. Get into our new emoji directory, in preparation for our next and final step: cd /var/www/mattermost/client/emoji
  5. The Noto files have a prefix of emoji_u instead of just the plain Unicode number: for example, instead of “1f642.png”, it’s labelled “emoji_u1f642.png”. We need to rename all these files to exclude the “emoji_u” part. If you have the rename command installed, this can be done using: sudo rename 's/emoji_u(.*).png/$1.png/' *.png

And that’s it! Now if you reload the Mattermost page, you’ll see the new emoji pop up right away. (If it doesn’t work, you may have to clear your browser’s cache or something first).

Hope that helps, and if anyone tries this, let me know if it works :slight_smile:

1 Like