module Slack::Endpoint::Channels

Public Instance Methods

channels_archive(options={}) click to toggle source

This method archives a channel.

@option options [Object] :channel

Channel to archive

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

# File lib/slack/endpoint/channels.rb, line 14
def channels_archive(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.archive", options)
end
channels_create(options={}) click to toggle source

This method is used to create a channel.

@option options [Object] :name

Name of channel to create

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

# File lib/slack/endpoint/channels.rb, line 28
def channels_create(options={})
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.create", options)
end
channels_history(options={}) click to toggle source

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

@option options [Object] :channel

Channel 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/channels.history @see github.com/aki017/slack-api-docs/blob/master/methods/channels.history.md @see github.com/aki017/slack-api-docs/blob/master/methods/channels.history.json

# File lib/slack/endpoint/channels.rb, line 54
def channels_history(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.history", options)
end
channels_info(options={}) click to toggle source

This method returns information about a team channel.

@option options [Object] :channel

Channel to get info on

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

# File lib/slack/endpoint/channels.rb, line 68
def channels_info(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.info", options)
end
channels_invite(options={}) click to toggle source

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

@option options [Object] :channel

Channel to invite user to.

@option options [Object] :user

User to invite to channel.

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

# File lib/slack/endpoint/channels.rb, line 84
def channels_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("channels.invite", options)
end
channels_join(options={}) click to toggle source

This method is used to join a channel. If the channel does not exist, it is created.

@option options [Object] :name

Name of channel to join

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

# File lib/slack/endpoint/channels.rb, line 100
def channels_join(options={})
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.join", options)
end
channels_kick(options={}) click to toggle source

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

@option options [Object] :channel

Channel to remove user from.

@option options [Object] :user

User to remove from channel.

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

# File lib/slack/endpoint/channels.rb, line 116
def channels_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("channels.kick", options)
end
channels_leave(options={}) click to toggle source

This method is used to leave a channel.

@option options [Object] :channel

Channel to leave

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

# File lib/slack/endpoint/channels.rb, line 131
def channels_leave(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.leave", options)
end
channels_list(options={}) click to toggle source

This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels. The number of (non-deactivated) members in each channel is also returned.

@option options [Object] :exclude_archived

Don't return archived channels.

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

# File lib/slack/endpoint/channels.rb, line 147
def channels_list(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.list", options)
end
channels_mark(options={}) click to toggle source

This method moves the read cursor in a channel.

@option options [Object] :channel

Channel to set reading cursor in.

@option options [Object] :ts

Timestamp of the most recently seen message.

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

# File lib/slack/endpoint/channels.rb, line 162
def channels_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("channels.mark", options)
end
channels_rename(options={}) click to toggle source

This method renames a team channel.

@option options [Object] :channel

Channel to rename

@option options [Object] :name

New name for channel.

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

# File lib/slack/endpoint/channels.rb, line 179
def channels_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("channels.rename", options)
end
channels_setPurpose(options={}) click to toggle source

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

@option options [Object] :channel

Channel to set the purpose of

@option options [Object] :purpose

The new purpose

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

# File lib/slack/endpoint/channels.rb, line 196
def channels_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("channels.setPurpose", options)
end
channels_setTopic(options={}) click to toggle source

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

@option options [Object] :channel

Channel to set the topic of

@option options [Object] :topic

The new topic

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

# File lib/slack/endpoint/channels.rb, line 213
def channels_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("channels.setTopic", options)
end
channels_unarchive(options={}) click to toggle source

This method unarchives a channel. The calling user is added to the channel.

@option options [Object] :channel

Channel to unarchive

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

# File lib/slack/endpoint/channels.rb, line 228
def channels_unarchive(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("channels.unarchive", options)
end