From c7b825d47e1133179abd0ab8bd792552698f7b7e Mon Sep 17 00:00:00 2001 From: Moin Uddin Date: Sat, 29 Apr 2017 00:52:55 +0500 Subject: [PATCH] added web.im.replies --- lib/clients/web/facets/im.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/clients/web/facets/im.js b/lib/clients/web/facets/im.js index 68d99d16f..fba07d6a7 100644 --- a/lib/clients/web/facets/im.js +++ b/lib/clients/web/facets/im.js @@ -7,6 +7,7 @@ * - list: {@link https://api.slack.com/methods/im.list|im.list} * - mark: {@link https://api.slack.com/methods/im.mark|im.mark} * - open: {@link https://api.slack.com/methods/im.open|im.open} + * - replies: {@link https://api.slack.com/methods/im.replies|im.replies} * */ @@ -99,5 +100,22 @@ ImFacet.prototype.open = function open(user, optCb) { return this.makeAPICall('im.open', requiredArgs, null, optCb); }; +/** + * Returns an entire thread (a message plus all the messages in reply to it). + * @see {@link https://api.slack.com/methods/im.replies|im.replies} + * + * @param {?} channel - Direct message channel to get replies from. + * @param {?} thread_ts - Timestamp of the parent message. + * @param {function=} optCb Optional callback, if not using promises. + */ +ImFacet.prototype.replies = function replies(channel, threadTs, optCb) { + var requiredArgs = { + channel: channel, + thread_ts: threadTs + }; + + return this.makeAPICall('im.replies', requiredArgs, null, optCb); +}; + module.exports = ImFacet;