Skip to content

Commit

Permalink
Add support for chat.postMessage API method
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhammond committed Jan 30, 2015
1 parent 5ebcc9d commit 9c81551
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/channel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ class Channel
m = new Message @_client, {text: text}
@sendMessage m

postMessage: (data) ->
params = data
params.channel = @id
if data.attachments
params.attachments = JSON.stringify(data.attachments)

@_client.logger.debug data
@_client.logger.debug params
@_client._apiCall "chat.postMessage", params, @_onPostMessage

_onPostMessage: (data) =>
@_client.logger.debug data

sendMessage: (message) ->
message.channel = @id
@_client._send(message)
Expand Down

0 comments on commit 9c81551

Please sign in to comment.