Skip to content

Commit

Permalink
Added api call to chat.update (#41)
Browse files Browse the repository at this point in the history
Added api call to chat.update
  • Loading branch information
v3xx3d authored and mishk0 committed Oct 6, 2016
1 parent 6249af4 commit c43f4ee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,25 @@ Bot.prototype.postMessage = function(id, text, params) {
return this._api('chat.postMessage', params);
};

/**
* Updates a message by timestamp
* @param {string} id - channel ID
* @param {string} ts - timestamp
* @param {string} text
* @param {object} params
* @returns {vow.Promise}
*/
Bot.prototype.updateMessage = function(id, ts, text, params) {
params = extend({
ts: ts,
channel: id,
username: this.name,
text: text
}, params || {});

return this._api('chat.update', params);
};

/**
* Posts a message to user by name
* @param {string} name
Expand Down

0 comments on commit c43f4ee

Please sign in to comment.