layout | title | permalink |
---|---|---|
page |
SlackDataStore |
/reference/SlackDataStore |
Kind: global class
- SlackDataStore
- new SlackDataStore(opts)
- .logger :
function
- .registerMessageHandler(event, handler)
- .clear()
- .getUserById(userId) ⇒
Object
- .getUserByName(name) ⇒
Object
- .getUserByEmail(email) ⇒
Object
- .getUserByBotId(botId) ⇒
Object
- .getChannelById(channelId) ⇒
Object
- .getChannelByName(name) ⇒
Object
- .getGroupById(groupId) ⇒
Object
- .getGroupByName(name) ⇒
Object
- .getDMById(dmId) ⇒
Object
- .getDMByName(name) ⇒
Object
- .getDMByUserId(id) ⇒
Object
- .getBotById(botId) ⇒
Object
- .getBotByName(name) ⇒
Object
- .getBotByUserId(userId) ⇒
Object
- .getTeamById(name) ⇒
Object
- .getUnreadCount()
- .setChannel(channel)
- .setGroup(group)
- .setDM(dm)
- .setUser(user)
- .setBot(bot)
- .setTeam(team)
- .upsertChannel(channel)
- .upsertGroup(group)
- .upsertDM(dm)
- .upsertUser(user)
- .upsertBot(bot)
- .upsertTeam(team)
- .upsertChannelGroupOrDMById(id, obj)
- .getChannelGroupOrDMById(objId) ⇒
Object
- .getChannelOrGroupByName(objId) ⇒
Object
- .cacheRtmStart(data)
- .handleRtmMessage(activeUserId, activeTeamId, messageType, message)
Param | Type | Description |
---|---|---|
opts | Object |
|
[opts.logLevel] | string |
The log level for the logger. |
[opts.logger] | function |
Function to use for log calls, takes (logLevel, logString) params. |
The logger function attached to this client.
Kind: instance property of SlackDataStore
Sets a handler to save RTM event data to the data-store.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
event | string |
handler | function |
Clears the data store and re-sets it to the required starting state.
Kind: instance method of SlackDataStore
Returns the User object matching the supplied id.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
userId | string |
Returns the User object matching the supplied name.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
name | string |
Returns the User object matching the supplied email.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
string |
Returns the User object matching the supplied bot ID.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
botId | string |
Returns the Channel object matching the supplied id.
Kind: instance method of SlackDataStore
Param |
---|
channelId |
Returns the Channel object matching the supplied name.
Kind: instance method of SlackDataStore
Param |
---|
name |
Returns the Group object matching the supplied id.
Kind: instance method of SlackDataStore
Param |
---|
groupId |
Returns the Group object matching the supplied name.
Kind: instance method of SlackDataStore
Param |
---|
name |
Returns the DM object matching the supplied id.
Kind: instance method of SlackDataStore
Param |
---|
dmId |
Returns the DM object between the registered user and the user with the supplied name.
Kind: instance method of SlackDataStore
Param |
---|
name |
Returns the DM object between the registered user and the user with the supplied id.
Kind: instance method of SlackDataStore
Param |
---|
id |
Returns the bot object matching the supplied id.
Kind: instance method of SlackDataStore
Param |
---|
botId |
Returns the bot object matching the supplied name.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
name | string |
Returns the bot object matching the supplied user ID.
Kind: instance method of SlackDataStore
Param |
---|
userId |
Returns the bot object matching the supplied name.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
name | string |
Returns the unread count for all objects: channels, groups etc.
Kind: instance method of SlackDataStore
Stores a channel object in the data store.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
channel | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
group | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
dm | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
user | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
bot | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
team | Object |
Kind: instance method of SlackDataStore
Param |
---|
channel |
Kind: instance method of SlackDataStore
Param |
---|
group |
Kind: instance method of SlackDataStore
Param |
---|
dm |
Kind: instance method of SlackDataStore
Param |
---|
user |
Kind: instance method of SlackDataStore
Param |
---|
bot |
Kind: instance method of SlackDataStore
Param |
---|
team |
Kind: instance method of SlackDataStore
Param |
---|
id |
obj |
Returns the channel, group or DM object matching the supplied Id.
Kind: instance method of SlackDataStore
Param |
---|
objId |
Returns the channel or group object matching name, finding by channel, then group then DM.
Kind: instance method of SlackDataStore
Param |
---|
objId |
Caches an rtm.start response to the datastore.
Kind: instance method of SlackDataStore
Param | Type |
---|---|
data | Object |
Kind: instance method of SlackDataStore
Param | Type |
---|---|
activeUserId | string |
activeTeamId | string |
messageType | string |
message | Object |