Methods
(async, inner) add(subdomains, tokens, cookies, options) → {Promise.<addResponseObject>}
Add emoji described by parameters within options to the specified subdomain(s).
Note that options can accept both aliases and original emoji at the same time, but ordering can get complicated and honestly I'd skip it if I were you. For each emoji, make sure that every descriptor (src, name, aliasFor) has a value, using null
s for fields that are not relevant to the current emoji.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
subdomains |
string | Array.<string> |
a single or list of subdomains to add emoji to. Must match respectively to |
||||||||||||||||||||||||||||||||||||
tokens |
string | Array.<string> |
a single or list of tokens to add emoji to. 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 addOptions = {
src: ['./emoji1.jpg', 'http://example.com/emoji2.png'], // upload these two images
name: ['myLocalEmoji', 'myOnlineEmoji'], // call them these two names
bustCache: false, // don't bother redownloading existing emoji
avoidCollisions: true, // if there are similarly named emoji, change my new emoji names
output: false // don't write any files
};
var subdomains = ['mySubdomain1', 'mySubdomain2'] // can add one or multiple
var tokens = ['myToken1', 'myToken2'] // can add one or multiple
var cookies = ['myCookie1', 'myCookie2'] // can add one or multiple
var addResults = await emojme.add(subdomains, tokens, cookies, addOptions);
console.log(userStatsResults);
// {
// mySubomain1: {
// collisions: [], // only defined if avoidCollisons = false
// emojiList: [
// { name: 'myLocalEmoji', ... },
// { name: 'myOnlineEmoji', ... },
// ]
// },
// mySubomain2: {
// collisions: [], // only defined if avoidCollisons = false
// emojiList: [
// { name: 'myLocalEmoji', ... },
// { name: 'myOnlineEmoji', ... },
// ]
// }
// }
Type Definitions
addResponseObject :object
The add 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: