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

This method 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:



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

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

#groups_close(options = {}) ⇒ Object

This method closes a private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to open.

See Also:



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

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

#groups_create(options = {}) ⇒ Object

This method 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:



39
40
41
42
# File 'lib/slack/web/api/endpoints/groups.rb', line 39

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

#groups_createChild(options = {}) ⇒ Object

This method takes an existing private group and performs the following steps:

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to clone and archive.

See Also:



51
52
53
54
# File 'lib/slack/web/api/endpoints/groups.rb', line 51

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

#groups_history(options = {}) ⇒ Object

This method returns a portion of messages/events from the specified private group. To read the entire history for a group, call the method with no latest or oldest arguments, and then continue paging using the instructions below.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to fetch history for.

  • :latest (timestamp)

    End of time range of messages to include in results.

  • :oldest (timestamp)

    Start of time range of messages to include in results.

  • :inclusive (Object)

    Include messages with latest or oldest timestamp in results.

See Also:



71
72
73
74
# File 'lib/slack/web/api/endpoints/groups.rb', line 71

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

#groups_info(options = {}) ⇒ Object

This method returns information about a private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to get info on.

See Also:



83
84
85
86
# File 'lib/slack/web/api/endpoints/groups.rb', line 83

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

#groups_invite(options = {}) ⇒ Object

This method is used to invite a user to a private group. The calling user must be a member of the 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:



97
98
99
100
101
# File 'lib/slack/web/api/endpoints/groups.rb', line 97

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

This method allows a user to remove another member 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:



112
113
114
115
116
# File 'lib/slack/web/api/endpoints/groups.rb', line 112

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

This method is used to leave a private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to leave.

See Also:



125
126
127
128
# File 'lib/slack/web/api/endpoints/groups.rb', line 125

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

#groups_list(options = {}) ⇒ Object

This method returns a list of groups in the team that the caller is in and archived groups that the caller was in. The list of (non-deactivated) members in each group is also returned.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :exclude_archived (Object)

    Don’t return archived groups.

See Also:



138
139
140
# File 'lib/slack/web/api/endpoints/groups.rb', line 138

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

#groups_mark(options = {}) ⇒ Object

This method moves 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:



151
152
153
154
155
# File 'lib/slack/web/api/endpoints/groups.rb', line 151

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

This method opens a private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to open.

See Also:



164
165
166
167
# File 'lib/slack/web/api/endpoints/groups.rb', line 164

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

#groups_rename(options = {}) ⇒ Object

This method renames a private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Group to rename.

  • :name (Object)

    New name for group.

See Also:



178
179
180
181
182
# File 'lib/slack/web/api/endpoints/groups.rb', line 178

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

This method is used to change the purpose of a private group. The calling user must be a member of the private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Private group to set the purpose of.

  • :purpose (Object)

    The new purpose.

See Also:



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

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

This method is used to change the topic of a private group. The calling user must be a member of the private group.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Private group to set the topic of.

  • :topic (Object)

    The new topic.

See Also:



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

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

This method 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