Module: Slack::Endpoint::Groups

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/groups.rb

Instance Method Summary collapse

Instance Method Details

#groups_archive(options = {}) ⇒ Object

This method archives a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to archive

See Also:



14
15
16
17
18
# File 'lib/slack/endpoint/groups.rb', line 14

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

#groups_close(options = {}) ⇒ Object

This method closes a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to close.

See Also:



28
29
30
31
32
# File 'lib/slack/endpoint/groups.rb', line 28

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

#groups_create(options = {}) ⇒ Object

This method creates a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :name (Object)

    Name of private channel to create

See Also:



42
43
44
45
46
# File 'lib/slack/endpoint/groups.rb', line 42

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

#groups_createChild(options = {}) ⇒ Object

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to clone and archive.

See Also:



56
57
58
59
60
# File 'lib/slack/endpoint/groups.rb', line 56

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

#groups_history(options = {}) ⇒ Object

This method returns a portion of messages/events from the specified private channel. To read the entire history for a private channel, 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 (Object)

    Private channel to fetch history for.

  • :latest (Object)

    End of time range of messages to include in results.

  • :oldest (Object)

    Start of time range of messages to include in results.

  • :inclusive (Object)

    Include messages with latest or oldest timestamp in results.

  • :count (Object)

    Number of messages to return, between 1 and 1000.

  • :unreads (Object)

    Include unread_count_display in the output?

See Also:



82
83
84
85
86
# File 'lib/slack/endpoint/groups.rb', line 82

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

#groups_info(options = {}) ⇒ Object

This method returns information about a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to get info on

See Also:



96
97
98
99
100
# File 'lib/slack/endpoint/groups.rb', line 96

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

#groups_invite(options = {}) ⇒ Object

This method is used to invite a user to a private channel. The calling user must be a member of the private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to invite user to.

  • :user (Object)

    User to invite.

See Also:



112
113
114
115
116
117
# File 'lib/slack/endpoint/groups.rb', line 112

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.invite", options)
end

#groups_kick(options = {}) ⇒ Object

This method allows a user to remove another member from a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to remove user from.

  • :user (Object)

    User to remove from private channel.

See Also:



129
130
131
132
133
134
# File 'lib/slack/endpoint/groups.rb', line 129

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.kick", options)
end

#groups_leave(options = {}) ⇒ Object

This method is used to leave a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to leave

See Also:



144
145
146
147
148
# File 'lib/slack/endpoint/groups.rb', line 144

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

#groups_list(options = {}) ⇒ Object

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :exclude_archived (Object)

    Don’t return archived private channels.

See Also:



159
160
161
162
# File 'lib/slack/endpoint/groups.rb', line 159

def groups_list(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.list", options)
end

#groups_mark(options = {}) ⇒ Object

This method moves the read cursor in a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to set reading cursor in.

  • :ts (Object)

    Timestamp of the most recently seen message.

See Also:



174
175
176
177
178
179
# File 'lib/slack/endpoint/groups.rb', line 174

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.mark", options)
end

#groups_open(options = {}) ⇒ Object

This method opens a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to open.

See Also:



189
190
191
192
193
# File 'lib/slack/endpoint/groups.rb', line 189

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

#groups_rename(options = {}) ⇒ Object

This method renames a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to rename

  • :name (Object)

    New name for private channel.

See Also:



205
206
207
208
209
210
# File 'lib/slack/endpoint/groups.rb', line 205

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.rename", options)
end

#groups_replies(options = {}) ⇒ Object

This method returns an entire thread (a message plus all the messages in reply to it).

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to fetch thread from

  • :thread_ts (Object)

    Unique identifier of a thread’s parent message

See Also:



222
223
224
225
226
227
# File 'lib/slack/endpoint/groups.rb', line 222

def groups_replies(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :thread_ts missing") if options[:thread_ts].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.replies", options)
end

#groups_setPurpose(options = {}) ⇒ Object

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to set the purpose of

  • :purpose (Object)

    The new purpose

See Also:



239
240
241
242
243
244
# File 'lib/slack/endpoint/groups.rb', line 239

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.setPurpose", options)
end

#groups_setTopic(options = {}) ⇒ Object

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to set the topic of

  • :topic (Object)

    The new topic

See Also:



256
257
258
259
260
261
# File 'lib/slack/endpoint/groups.rb', line 256

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("groups.setTopic", options)
end

#groups_unarchive(options = {}) ⇒ Object

This method unarchives a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to unarchive

See Also:



271
272
273
274
275
# File 'lib/slack/endpoint/groups.rb', line 271

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