Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from Japh/master
Browse files Browse the repository at this point in the history
Add support for Multi Party Instant Messaging endpoints
  • Loading branch information
germanrcuriel committed Nov 14, 2015
2 parents 19acced + f0649f5 commit 8ae8f22
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/api/mpim.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
BaseClass = require './common/base_class'

class MPIM extends BaseClass

endpoints:
close: '/api/mpim.close'
history: '/api/mpim.history'
list: '/api/mpim.list'
mark: '/api/mpim.mark'
open: '/api/mpim.open'

#
# Official API Methods
#
close: (opts = {}, callback) ->
@validate.obj opts, [ 'channel' ]
@request 'POST', @endpoints.close, opts, callback

history: (opts = {}, callback) ->
@validate.obj opts, [ 'channel' ]
@request 'GET', @endpoints.history, opts, callback

list: (callback) ->
@request 'GET', @endpoints.list, {}, callback

mark: (opts = {}, callback) ->
@validate.obj opts, [ 'channel', 'ts' ]
@request 'POST', @endpoints.mark, opts, callback

open: (opts = {}, callback) ->
@validate.obj opts, [ 'users' ]
@request 'POST', @endpoints.open, opts, callback

module.exports = MPIM
1 change: 1 addition & 0 deletions src/slack.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Slack
'emoji': require './api/emoji'
'groups': require './api/groups'
'im': require './api/im'
'mpim': require './api/mpim'
'oauth': require './api/oauth'
'rtm': require './api/rtm'
'search': require './api/search'
Expand Down

0 comments on commit 8ae8f22

Please sign in to comment.