download

Methods

(async, inner) download(subdomains, tokens, cookies, options) → {Promise.<downloadResponseObject>}

Download the list of custom emoji that have been added to the given slack instances, by default saving a json of all available relevant data. Optionally save the source images for a given user.

Parameters:
Name Type Description
subdomains string | Array.<string>

a single or list of subdomains from which to download emoji. Must match respectively to tokens and cookies.

tokens string | Array.<string>

a single or list of tokens with which to authenticate. Must match respectively to subdomains and cookies.

cookies string | Array.<string>

a single or list of cookies used to authenticate access to the given subdomain. Must match respectively to subdomains and tokens.

options object

contains singleton or arrays of emoji descriptors.

Properties
Name Type Attributes Description
save string | Array.<string> <optional>

A user name or array of user names whose emoji source images will be saved. All emoji source images are linked to in the default adminList, but passing a user name here will save that user's emoji to build//

saveAll boolean <optional>

if true, download all emoji on slack instance from all users to disk in a single location.

saveAllByUser boolean <optional>

if true, download all emoji on slack instance from all users to disk, organized into directories by user.

bustCache boolean <optional>

if true, ignore any adminList younger than 24 hours and repull slack instance's existing emoji. Can be useful for making options.avoidCollisions more accurate

output boolean <optional>

if false, no files will be written during execution. Prevents saving of adminList for future use, as well as the writing of log files

verbose boolean <optional>

if true, all messages will be written to stdout in addition to combined log file.

Source:
Example
var downloadOptions = {
  save: ['username_1', 'username_2'], // Download the emoji source files for these two users
  bustCache: true, // make sure this data is fresh
  output: true // download the adminList to ./build
};
var downloadResults = await emojme.download('mySubdomain', 'myToken', 'myCookie', downloadOptions);
console.log(downloadResults);
// {
//   mySubdomain: {
//     emojiList: [
//       { name: 'emoji-from-mySubdomain', ... },
//       ...
//     ],
//     saveResults: [
//       './build/mySubdomain/username_1/an_emoji.jpg',
//       './build/mySubdomain/username_1/another_emoji.gif',
//       ... all of username_1's emoji
//       './build/mySubdomain/username_2/some_emoji.jpg',
//       './build/mySubdomain/username_2/some_other_emoji.gif',
//       ... all of username_2's emoji
//     ]
//   }
// }

Type Definitions

downloadResponseObject :object

The download 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
Name Type Description
emojiList Array.<emojiList>

the list of emoji downloaded from subdomain

saveResults Array.<string>

an array of paths for emoji that have been downloaded. note that all users that have been passed with options.save will be grouped together here.

Source: