module Slack::Endpoint::Groups

Public Instance Methods

groups_archive(options={}) click to toggle source

This method archives a private group.

@option options [Object] :channel

Private group to archive

@see api.slack.com/methods/groups.archive @see github.com/aki017/slack-api-docs/blob/master/methods/groups.archive.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.archive.json

# 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={}) click to toggle source

This method closes a private group.

@option options [Object] :channel

Group to close.

@see api.slack.com/methods/groups.close @see github.com/aki017/slack-api-docs/blob/master/methods/groups.close.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.close.json

# 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={}) click to toggle source

This method creates a private group.

@option options [Object] :name

Name of group to create

@see api.slack.com/methods/groups.create @see github.com/aki017/slack-api-docs/blob/master/methods/groups.create.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.create.json

# 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={}) click to toggle source

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

@option options [Object] :channel

Group to clone and archive.

@see api.slack.com/methods/groups.createChild @see github.com/aki017/slack-api-docs/blob/master/methods/groups.createChild.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.createChild.json

# 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={}) click to toggle source

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.

@option options [Object] :channel

Group to fetch history for.

@option options [Object] :latest

End of time range of messages to include in results.

@option options [Object] :oldest

Start of time range of messages to include in results.

@option options [Object] :inclusive

Include messages with latest or oldest timestamp in results.

@option options [Object] :count

Number of messages to return, between 1 and 1000.

@option options [Object] :unreads

Include unread_count_display in the output?

@see api.slack.com/methods/groups.history @see github.com/aki017/slack-api-docs/blob/master/methods/groups.history.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.history.json

# 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={}) click to toggle source

This method returns information about a private group.

@option options [Object] :channel

Group to get info on

@see api.slack.com/methods/groups.info @see github.com/aki017/slack-api-docs/blob/master/methods/groups.info.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.info.json

# 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={}) click to toggle source

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

@option options [Object] :channel

Private group to invite user to.

@option options [Object] :user

User to invite.

@see api.slack.com/methods/groups.invite @see github.com/aki017/slack-api-docs/blob/master/methods/groups.invite.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.invite.json

# 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={}) click to toggle source

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

@option options [Object] :channel

Group to remove user from.

@option options [Object] :user

User to remove from group.

@see api.slack.com/methods/groups.kick @see github.com/aki017/slack-api-docs/blob/master/methods/groups.kick.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.kick.json

# 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={}) click to toggle source

This method is used to leave a private group.

@option options [Object] :channel

Group to leave

@see api.slack.com/methods/groups.leave @see github.com/aki017/slack-api-docs/blob/master/methods/groups.leave.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.leave.json

# 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={}) click to toggle source

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.

@option options [Object] :exclude_archived

Don't return archived groups.

@see api.slack.com/methods/groups.list @see github.com/aki017/slack-api-docs/blob/master/methods/groups.list.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.list.json

# 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={}) click to toggle source

This method moves the read cursor in a private group.

@option options [Object] :channel

Group to set reading cursor in.

@option options [Object] :ts

Timestamp of the most recently seen message.

@see api.slack.com/methods/groups.mark @see github.com/aki017/slack-api-docs/blob/master/methods/groups.mark.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.mark.json

# 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={}) click to toggle source

This method opens a private group.

@option options [Object] :channel

Group to open.

@see api.slack.com/methods/groups.open @see github.com/aki017/slack-api-docs/blob/master/methods/groups.open.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.open.json

# 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={}) click to toggle source

This method renames a private group.

@option options [Object] :channel

Group to rename

@option options [Object] :name

New name for group.

@see api.slack.com/methods/groups.rename @see github.com/aki017/slack-api-docs/blob/master/methods/groups.rename.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.rename.json

# 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_setPurpose(options={}) click to toggle source

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

@option options [Object] :channel

Private group to set the purpose of

@option options [Object] :purpose

The new purpose

@see api.slack.com/methods/groups.setPurpose @see github.com/aki017/slack-api-docs/blob/master/methods/groups.setPurpose.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.setPurpose.json

# File lib/slack/endpoint/groups.rb, line 222
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={}) click to toggle source

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

@option options [Object] :channel

Private group to set the topic of

@option options [Object] :topic

The new topic

@see api.slack.com/methods/groups.setTopic @see github.com/aki017/slack-api-docs/blob/master/methods/groups.setTopic.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.setTopic.json

# File lib/slack/endpoint/groups.rb, line 239
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={}) click to toggle source

This method unarchives a private group.

@option options [Object] :channel

Group to unarchive

@see api.slack.com/methods/groups.unarchive @see github.com/aki017/slack-api-docs/blob/master/methods/groups.unarchive.md @see github.com/aki017/slack-api-docs/blob/master/methods/groups.unarchive.json

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