Module: Slack::Endpoint::Channels
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/channels.rb
Instance Method Summary collapse
-
#channels_archive(options = {}) ⇒ Object
Archives a channel.
-
#channels_create(options = {}) ⇒ Object
Creates a channel.
-
#channels_history(options = {}) ⇒ Object
Fetches history of messages and events from a channel.
-
#channels_info(options = {}) ⇒ Object
Gets information about a channel.
-
#channels_invite(options = {}) ⇒ Object
Invites a user to a channel.
-
#channels_join(options = {}) ⇒ Object
Joins a channel, creating it if needed.
-
#channels_kick(options = {}) ⇒ Object
Removes a user from a channel.
-
#channels_leave(options = {}) ⇒ Object
Leaves a channel.
-
#channels_list(options = {}) ⇒ Object
Lists all channels in a Slack team.
-
#channels_mark(options = {}) ⇒ Object
Sets the read cursor in a channel.
-
#channels_rename(options = {}) ⇒ Object
Renames a channel.
-
#channels_setPurpose(options = {}) ⇒ Object
Sets the purpose for a channel.
-
#channels_setTopic(options = {}) ⇒ Object
Sets the topic for a channel.
-
#channels_unarchive(options = {}) ⇒ Object
Unarchives a channel.
Instance Method Details
#channels_archive(options = {}) ⇒ Object
Archives a channel.
14 15 16 17 |
# File 'lib/slack/endpoint/channels.rb', line 14 def channels_archive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.archive", ) end |
#channels_create(options = {}) ⇒ Object
Creates a channel.
27 28 29 30 |
# File 'lib/slack/endpoint/channels.rb', line 27 def channels_create(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? post("channels.create", ) end |
#channels_history(options = {}) ⇒ Object
Fetches history of messages and events from a channel.
46 47 48 49 |
# File 'lib/slack/endpoint/channels.rb', line 46 def channels_history(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.history", ) end |
#channels_info(options = {}) ⇒ Object
Gets information about a channel.
59 60 61 62 |
# File 'lib/slack/endpoint/channels.rb', line 59 def channels_info(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.info", ) end |
#channels_invite(options = {}) ⇒ Object
Invites a user to a channel.
74 75 76 77 78 |
# File 'lib/slack/endpoint/channels.rb', line 74 def channels_invite(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :user missing") if [:user].nil? post("channels.invite", ) end |
#channels_join(options = {}) ⇒ Object
Joins a channel, creating it if needed.
88 89 90 91 |
# File 'lib/slack/endpoint/channels.rb', line 88 def channels_join(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? post("channels.join", ) end |
#channels_kick(options = {}) ⇒ Object
Removes a user from a channel.
103 104 105 106 107 |
# File 'lib/slack/endpoint/channels.rb', line 103 def channels_kick(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :user missing") if [:user].nil? post("channels.kick", ) end |
#channels_leave(options = {}) ⇒ Object
Leaves a channel.
117 118 119 120 |
# File 'lib/slack/endpoint/channels.rb', line 117 def channels_leave(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.leave", ) end |
#channels_list(options = {}) ⇒ Object
Lists all channels in a Slack team.
130 131 132 |
# File 'lib/slack/endpoint/channels.rb', line 130 def channels_list(={}) post("channels.list", ) end |
#channels_mark(options = {}) ⇒ Object
Sets the read cursor in a channel.
144 145 146 147 148 |
# File 'lib/slack/endpoint/channels.rb', line 144 def channels_mark(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? post("channels.mark", ) end |
#channels_rename(options = {}) ⇒ Object
Renames a channel.
160 161 162 163 164 |
# File 'lib/slack/endpoint/channels.rb', line 160 def channels_rename(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :name missing") if [:name].nil? post("channels.rename", ) end |
#channels_setPurpose(options = {}) ⇒ Object
Sets the purpose for a channel.
176 177 178 179 180 |
# File 'lib/slack/endpoint/channels.rb', line 176 def channels_setPurpose(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :purpose missing") if [:purpose].nil? post("channels.setPurpose", ) end |
#channels_setTopic(options = {}) ⇒ Object
Sets the topic for a channel.
192 193 194 195 196 |
# File 'lib/slack/endpoint/channels.rb', line 192 def channels_setTopic(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :topic missing") if [:topic].nil? post("channels.setTopic", ) end |
#channels_unarchive(options = {}) ⇒ Object
Unarchives a channel.
206 207 208 209 |
# File 'lib/slack/endpoint/channels.rb', line 206 def channels_unarchive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.unarchive", ) end |