Methods
(async, inner) upload(subdomains, tokens, cookies, options) → {Promise.<uploadResponseObject>}
Upload multiple emoji described by an existing list on disk, either as a json emoji admin list or emojipacks-like yaml.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
subdomains |
string | Array.<string> |
a single or list of subdomains from which to download emoji. Must match respectively to |
||||||||||||||||||||||||||||
tokens |
string | Array.<string> |
a single or list of tokens with which to authenticate. Must match respectively to |
||||||||||||||||||||||||||||
cookies |
string | Array.<string> |
a single or list of cookies used to authenticate access to the given subdomain. Must match respectively to |
||||||||||||||||||||||||||||
options |
object |
contains singleton or arrays of emoji descriptors. Properties
|
- Source:
Example
var uploadOptions = {
src: './emoji-list.json', // upload all the emoji in this json array of objects
avoidCollisions: true, // append '-1' or similar if we try to upload a dupe
prefix: 'new-' // prepend every emoji in src with "new-", e.g. "emoji" becomes "new-emoji"
};
var uploadResults = await emojme.upload('mySubdomain', 'myToken', 'myCookie', uploadOptions);
console.log(uploadResults);
// {
// mySubdomain: {
// collisions: [
// { name: an-emoji-that-already-exists-in-mySubdomain ... }
// ],
// emojiList: [
// { name: emoji-from-emoji-list-json ... },
// { name: emoji-from-emoji-list-json ... },
// ...
// ]
// }
// }
Type Definitions
jsonEmojiListFormat :Array
The required format of a json file that can be used as the options.src
for upload
To see an example, use download, then look at buidl/*.adminList.json
Properties:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
emojiList |
Array |
Properties
|
- Source:
Example
[
{
"name": "a_giving_lovely_generous_individual",
"is_alias": 1,
"alias_for": "caleb"
},
{
"name": "gooddoggy",
"is_alias": 0,
"alias_for": null,
"url": "https://emoji.slack-edge.com/T3T9KQULR/gooddoggy/849f53cf1de25f97.png"
}
]
syncResponseObject :object
The upload response object, like other response objects, is organized by input subdomain.
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
subdomain |
object |
each subdomain passed in to add will appear as a key in the response Properties
|
- Source:
yamlEmojiListFormat :object
The required format of a yaml file that can be used as the options.src
for upload
Properties:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
topLevelYaml |
object |
all keys execpt for |
|||||||||||||||||||||||||||
emojis |
Array |
the array of emoji objects Properties
|
- Source: