Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the FULL list of slack emoji through API?

Tags:

I am using the slack API to get the full list of emoji, so that when I get a message, I will just replace :squirrel: with the icon.

The method https://slack.com/api/emoji.list works like a charm, but returns 30 icons only. I think this is correct since in the documentation page (https://api.slack.com/methods/emoji.list) they say:

This method lists the custom emoji for a team.

Fair enough, but how can I get the full list of the associations icon-name / icon URL ?

like image 838
Ing. Luca Stucchi Avatar asked Sep 14 '16 12:09

Ing. Luca Stucchi


People also ask

How many emojis are there in Slack?

Slack now supports all 2,666 emojis listed as part of the Unicode Standard.

How do you find emojis on Slack?

Select an emoji from the menu Click the smiley face icon in the message field to open the menu. Use the icons at the top of the menu to browse categories, or search for an emoji code. Click an emoji to add it to your message.


1 Answers

I finally managed to get all the icons and to use them and I post here the solution for anyone that would like to use do similar:

  1. First of all, I got the Slack Custom Emoji through this slack URL

  2. Since at step 1 we get only Custom Emojis, it is useful to know that slack uses standard emoji defined in unicode characters, mapped through custom handles like :smiley: or :horse:. The good thing is that we can find, linked through slack page a link to a JSON object with all the emoji mappings. This file is HUGE, but has everything we need.

  3. In the file you'll find an array of javascript object like the one below:

{   "name":"SMILING FACE WITH OPEN MOUTH",   "unified":"1F603",   "variations":[],   "docomo":"E6F0",    "au":"E471",   "softbank":"E057",   "google":"FE330",   "image":"1f603.png",   "sheet_x":26,   "sheet_y":18,"   short_name":"smiley",   "short_names":["smiley"],   "text":":)",   "texts":["=)","=-)"],   "category":"People",   "sort_order":5,   "has_img_apple":true,   "has_img_google":true,   "has_img_twitter":true,   "has_img_emojione":true  }

I used the following information:

  • shortnames are the names that are used in slack (you'll need to turn smiley into :smiley: )
  • unified is the unicode character to use (to use it directly in an HTML page you'll need to add &#x so in this case you'll have to use 😃 which is rendered 😃

Using this information you will be able to create a slack-to-html function to decode emojis and display them wherever you want

like image 115
Ing. Luca Stucchi Avatar answered Oct 13 '22 01:10

Ing. Luca Stucchi