![]() ![]() Outcome depends on if methodCache.create was done for the method. ![]() Implements either asyncCall or cacheCall if cache exists Resolves with server results or cached if still valid.Accepts a method name and single param (used as cache key).Accepts a method name and params (array or single param).Wraps server method calls to always be async If allPublic is true, the rooms option will be ignored. If rooms are given as option or set in the environment with ROCKETCHAT_ROOMīut have not been joined yet this method will join to those rooms automatically. options.edited : respond to edited messages.options.livechat : respond to messages in Livechat rooms.options.dm : respond to messages in DMs with the SDK user.options.allPublic : respond to messages on all channels.options.rooms : respond to messages in joined rooms.This is a more user-friendly method for bots to subscribe to a message stream.įires callback after filters run on subscription events.Īccepts options object, that parallels respond filter env variables: Proxy for reactToMessages with some filtering of messages based on config. driver.respondToMessages(callback, options) Third argument is additional attributes, such as roomTypeįor example usage, see the Rocket.Chat Hubot adapter's receive function, which.Once a subscription is created, using driver.subscribeToMessages() this methodĬan be used to attach a callback to changes in the message stream.įires callback with every change in subscriptions. Shortcut to subscribe to user's message stream Resolves with subscription instance (with ID).Accepts parameters for Rocket.Chat streamer.Uses defaults from env ROCKETCHAT_USER and ROCKETCHAT_PASSWORD.Accepts object with username and/or email and password.Unsubscribe, logout, disconnect from Rocket.Chat Can return a promise, or use error-first callback pattern.Options accepts host and timeout attributes.New Message class instances directly if detailed attributes are required. Simple message creation and the message module can also be imported to create The driver.prepareMessage method (documented below) provides a helper for The structure for messages in this package matches that schema, with a The Rocket.Chat message schema can be found here: Run ts-node src/utils/users.ts for a demo of user query outputs. Some common requests for user queries are made available as simple helpers underĪpi.users, such as () which returns the user IDs of all Parameters defining the endpoint, payload and if authorization is required Rocket.Chat REST API calls can be made via api.get or api.post, with More advanced methods that can be called from the driver.asteroid interface. Server methods are not fullyĭocumented, most require searching the Rocket.Chat codebase.ĭriver methods use an Asteroid DDP connection. Const from Rocket.Chat server method can be called via driver.callMethod,ĭriver.cacheCall or driver.asyncCall. ![]()
0 Comments
Leave a Reply. |