Module: Slack::Web::Api::Endpoints::Groups

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/groups.rb

Instance Method Summary collapse

Instance Method Details

#groups_archive(options = {}) ⇒ Object

Archives a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Private group to archive

See Also:



16
17
18
19
# File 'lib/slack/web/api/endpoints/groups.rb', line 16

def groups_archive(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.archive', options)
end

#groups_close(options = {}) ⇒ Object

Closes a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to open.

See Also:



29
30
31
32
# File 'lib/slack/web/api/endpoints/groups.rb', line 29

def groups_close(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.close', options)
end

#groups_create(options = {}) ⇒ Object

Creates a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :name (Object)

    Name of group to create

See Also:



42
43
44
45
# File 'lib/slack/web/api/endpoints/groups.rb', line 42

def groups_create(options = {})
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  post('groups.create', options)
end

#groups_createChild(options = {}) ⇒ Object

Clones and archives a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to clone and archive.

See Also:



55
56
57
58
# File 'lib/slack/web/api/endpoints/groups.rb', line 55

def groups_createChild(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.createChild', options)
end

#groups_history(options = {}) ⇒ Object

Fetches history of messages and events from a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to fetch history for.

  • :latest (timestamp)

    Latest message timestamp to include in results.

  • :oldest (timestamp)

    Oldest message timestamp to include in results.

  • :count (Object)

    Number of messages to return, between 1 and 1000.

See Also:



74
75
76
77
# File 'lib/slack/web/api/endpoints/groups.rb', line 74

def groups_history(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.history', options)
end

#groups_invite(options = {}) ⇒ Object

Invites a user to a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Private group to invite user to.

  • :user (user)

    User to invite.

See Also:



89
90
91
92
93
# File 'lib/slack/web/api/endpoints/groups.rb', line 89

def groups_invite(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
  post('groups.invite', options)
end

#groups_kick(options = {}) ⇒ Object

Removes a user from a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to remove user from.

  • :user (user)

    User to remove from group.

See Also:



105
106
107
108
109
# File 'lib/slack/web/api/endpoints/groups.rb', line 105

def groups_kick(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
  post('groups.kick', options)
end

#groups_leave(options = {}) ⇒ Object

Leaves a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to leave

See Also:



119
120
121
122
# File 'lib/slack/web/api/endpoints/groups.rb', line 119

def groups_leave(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.leave', options)
end

#groups_list(options = {}) ⇒ Object

Lists private groups that the calling user has access to.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :exclude_archived (Object)

    Don’t return archived groups.

See Also:



132
133
134
# File 'lib/slack/web/api/endpoints/groups.rb', line 132

def groups_list(options = {})
  post('groups.list', options)
end

#groups_mark(options = {}) ⇒ Object

Sets the read cursor in a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to set reading cursor in.

  • :ts (timestamp)

    Timestamp of the most recently seen message.

See Also:



146
147
148
149
150
# File 'lib/slack/web/api/endpoints/groups.rb', line 146

def groups_mark(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
  post('groups.mark', options)
end

#groups_open(options = {}) ⇒ Object

Opens a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to open.

See Also:



160
161
162
163
# File 'lib/slack/web/api/endpoints/groups.rb', line 160

def groups_open(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.open', options)
end

#groups_rename(options = {}) ⇒ Object

Renames a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Group to rename

  • :name (Object)

    New name for group.

See Also:



175
176
177
178
179
# File 'lib/slack/web/api/endpoints/groups.rb', line 175

def groups_rename(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  post('groups.rename', options)
end

#groups_setPurpose(options = {}) ⇒ Object

Sets the purpose for a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Private group to set the purpose of

  • :purpose (Object)

    The new purpose

See Also:



191
192
193
194
195
# File 'lib/slack/web/api/endpoints/groups.rb', line 191

def groups_setPurpose(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
  post('groups.setPurpose', options)
end

#groups_setTopic(options = {}) ⇒ Object

Sets the topic for a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Private group to set the topic of

  • :topic (Object)

    The new topic

See Also:



207
208
209
210
211
# File 'lib/slack/web/api/endpoints/groups.rb', line 207

def groups_setTopic(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
  post('groups.setTopic', options)
end

#groups_unarchive(options = {}) ⇒ Object

Unarchives a private group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to unarchive

See Also:



221
222
223
224
# File 'lib/slack/web/api/endpoints/groups.rb', line 221

def groups_unarchive(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  post('groups.unarchive', options)
end