DataManager

DataManager

Class representing Slack and bot data.

Constructor

new DataManager(options)

Create a data manager.
Source:
Parameters:
Name Type Description
options Object The data manager options.

Members

(static) defaults

The default options used when constructing a data manager.
Source:

Methods

(static) create() → {DataManager}

Create a data manager (see DataManager for parameters).
Source:
Returns:
Type:
DataManager
The new data manager.

clearCaches() → {Boolean}

Clear all object caches.
Source:
Returns:
Type:
Boolean
Returns `true` if the caches were purged.

(async) getChannelById(channelId) → {Promise}

Get a single channel on the Slack instance by ID.
Source:
Parameters:
Name Type Description
channelId String The ID of the channel to get.
Returns:
Type:
Promise
Returns a promise which resolves with requested channel or `null` if one is not found.

(async) getChannels() → {Promise}

Get all channels on the Slack instance.
Source:
Returns:
Type:
Promise
Returns a promise which resolves with an array of channels.

(async) getChannelsById() → {Promise}

Get all channels on the the Slack instance as an object with channel IDs as keys.
Source:
Returns:
Type:
Promise
Returns a promise which resolves with indexed channels.

(async) getUserById(userId) → {Promise}

Get a single user who has access to the Slack instance by ID.
Source:
Parameters:
Name Type Description
userId String The ID of the user to get.
Returns:
Type:
Promise
Returns a promise which resolves with requested user or `null` if one is not found.

(async) getUsers() → {Promise}

Get all users who have access to the Slack instance.
Source:
Returns:
Type:
Promise
Returns a promise which resolves with an array of users.

(async) getUsersById() → {Promise}

Get all users who have access to the Slack instance as an object with user IDs as keys.
Source:
Returns:
Type:
Promise
Returns a promise which resolves with indexed users.