Module: Slack::Web::Channels

Included in:
Slack::Web
Defined in:
lib/slack/web/channels.rb

Constant Summary collapse

SCOPE =
"channels"

Instance Method Summary collapse

Instance Method Details

#channels_archive(channel) ⇒ Object

Archives a channel.



7
8
9
10
# File 'lib/slack/web/channels.rb', line 7

def channels_archive(channel)
  response = @session.do_get "#{SCOPE}.archive", "channel" => channel
  Slack::parse_response(response)
end

#channels_create(name) ⇒ Object

Creates a channel.



13
14
15
16
# File 'lib/slack/web/channels.rb', line 13

def channels_create(name)
  response = @session.do_get "#{SCOPE}.create", "name" => name
  Slack::parse_response(response)
end

#channels_history(channel, latest, oldest, inclusive, count) ⇒ Object

Fetches history of messages and events from a channel.



19
20
21
# File 'lib/slack/web/channels.rb', line 19

def channels_history(channel, latest, oldest, inclusive, count)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_info(channel) ⇒ Object

Gets information about a channel.



24
25
26
27
# File 'lib/slack/web/channels.rb', line 24

def channels_info(channel)
  response = @session.do_get "#{SCOPE}.info", "channel" => channel
  Slack::parse_response(response)
end

#channels_invite(channel, user) ⇒ Object

Invites a user to a channel.



30
31
32
# File 'lib/slack/web/channels.rb', line 30

def channels_invite(channel, user)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_join(name) ⇒ Object

Joins a channel, creating it if needed.



35
36
37
# File 'lib/slack/web/channels.rb', line 35

def channels_join(name)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_kick(channel, user) ⇒ Object

Removes a user from a channel.



40
41
42
# File 'lib/slack/web/channels.rb', line 40

def channels_kick(channel, user)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_leave(channel) ⇒ Object

Leaves a channel.



45
46
47
# File 'lib/slack/web/channels.rb', line 45

def channels_leave(channel)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_list(exclude_archived = 0) ⇒ Object

Lists all channels in a Slack team.



50
51
52
53
# File 'lib/slack/web/channels.rb', line 50

def channels_list(exclude_archived=0)
  response = @session.do_get "#{SCOPE}.list", "exclude_archived" => exclude_archived
  Slack::parse_response(response)
end

#channels_mark(channel, ts) ⇒ Object

Sets the read cursor in a channel.



56
57
58
# File 'lib/slack/web/channels.rb', line 56

def channels_mark(channel, ts)
  raise Slack::Error("Not yet implemented, feel free to make a pull request")
end

#channels_rename(channel, name) ⇒ Object

Renames a channel.



61
62
63
# File 'lib/slack/web/channels.rb', line 61

def channels_rename(channel, name)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_set_purpose(channel, purpose) ⇒ Object

Sets the purpose for a channel.



66
67
68
# File 'lib/slack/web/channels.rb', line 66

def channels_set_purpose(channel, purpose)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_set_topic(channel, topic) ⇒ Object

Sets the topic for a channel.



71
72
73
# File 'lib/slack/web/channels.rb', line 71

def channels_set_topic(channel, topic)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end

#channels_unarchive(channel) ⇒ Object

Unarchives a channel.



76
77
78
# File 'lib/slack/web/channels.rb', line 76

def channels_unarchive(channel)
  raise NotImplementedError.new("Not yet implemented, feel free to make a pull request")
end