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

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
# File 'lib/slack/endpoint/groups.rb', line 14

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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to close.

See Also:



27
28
29
30
# File 'lib/slack/endpoint/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

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

  • :validate (Object)

    Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.

See Also:



42
43
44
45
# File 'lib/slack/endpoint/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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to clone and archive.

See Also:



55
56
57
58
# File 'lib/slack/endpoint/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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to fetch history for.

  • :count (Object)

    Number of messages to return, between 1 and 1000.

  • :inclusive (Object)

    Include messages with latest or oldest timestamp in results.

  • :latest (Object)

    End of time range of messages to include in results.

  • :oldest (Object)

    Start of time range of messages to include in results.

  • :unreads (Object)

    Include unread_count_display in the output?

See Also:



78
79
80
81
# File 'lib/slack/endpoint/groups.rb', line 78

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

#groups_info(options = {}) ⇒ Object

Gets 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

  • :include_locale (Object)

    Set this to true to receive the locale for this group. Defaults to false

See Also:



93
94
95
96
# File 'lib/slack/endpoint/groups.rb', line 93

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

#groups_invite(options = {}) ⇒ Object

Invites a user to a 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:



108
109
110
111
112
# File 'lib/slack/endpoint/groups.rb', line 108

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



124
125
126
127
128
# File 'lib/slack/endpoint/groups.rb', line 124

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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to leave

See Also:



138
139
140
141
# File 'lib/slack/endpoint/groups.rb', line 138

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 channels 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 private channels.

  • :exclude_members (Object)

    Exclude the members from each group

See Also:



153
154
155
# File 'lib/slack/endpoint/groups.rb', line 153

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

#groups_mark(options = {}) ⇒ Object

Sets 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:



167
168
169
170
171
# File 'lib/slack/endpoint/groups.rb', line 167

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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to open.

See Also:



181
182
183
184
# File 'lib/slack/endpoint/groups.rb', line 181

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 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.

  • :validate (Object)

    Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.

See Also:



198
199
200
201
202
# File 'lib/slack/endpoint/groups.rb', line 198

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_replies(options = {}) ⇒ Object

Retrieve a thread of messages posted to a private channel

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:



214
215
216
217
218
# File 'lib/slack/endpoint/groups.rb', line 214

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?
  post("groups.replies", options)
end

#groups_setPurpose(options = {}) ⇒ Object

Sets the purpose for a 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:



230
231
232
233
234
# File 'lib/slack/endpoint/groups.rb', line 230

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



246
247
248
249
250
# File 'lib/slack/endpoint/groups.rb', line 246

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 channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Private channel to unarchive

See Also:



260
261
262
263
# File 'lib/slack/endpoint/groups.rb', line 260

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