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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (group)

    Private group 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

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :name (Object)

    Name of group to create

See Also:



40
41
42
43
# File 'lib/slack/endpoint/groups.rb', line 40

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:



53
54
55
56
# File 'lib/slack/endpoint/groups.rb', line 53

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:



72
73
74
75
# File 'lib/slack/endpoint/groups.rb', line 72

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:



87
88
89
90
91
# File 'lib/slack/endpoint/groups.rb', line 87

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:



103
104
105
106
107
# File 'lib/slack/endpoint/groups.rb', line 103

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:



117
118
119
120
# File 'lib/slack/endpoint/groups.rb', line 117

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



219
220
221
222
# File 'lib/slack/endpoint/groups.rb', line 219

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