Module: Slack::Endpoint::Channels
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/channels.rb
Instance Method Summary collapse
-
#channels_archive(options = {}) ⇒ Object
This method archives a channel.
-
#channels_create(options = {}) ⇒ Object
This method is used to create a channel.
-
#channels_history(options = {}) ⇒ Object
This method returns a portion of messages/events from the specified channel.
-
#channels_info(options = {}) ⇒ Object
This method returns information about a team channel.
-
#channels_invite(options = {}) ⇒ Object
This method is used to invite a user to a channel.
-
#channels_join(options = {}) ⇒ Object
This method is used to join a channel.
-
#channels_kick(options = {}) ⇒ Object
This method allows a user to remove another member from a team channel.
-
#channels_leave(options = {}) ⇒ Object
This method is used to leave a channel.
-
#channels_list(options = {}) ⇒ Object
This method returns a list of all channels in the team.
-
#channels_mark(options = {}) ⇒ Object
This method moves the read cursor in a channel.
-
#channels_rename(options = {}) ⇒ Object
This method renames a team channel.
-
#channels_setPurpose(options = {}) ⇒ Object
This method is used to change the purpose of a channel.
-
#channels_setTopic(options = {}) ⇒ Object
This method is used to change the topic of a channel.
-
#channels_unarchive(options = {}) ⇒ Object
This method unarchives a channel.
Instance Method Details
#channels_archive(options = {}) ⇒ Object
This method archives a channel.
14 15 16 17 18 |
# File 'lib/slack/endpoint/channels.rb', line 14 def channels_archive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.archive", ) end |
#channels_create(options = {}) ⇒ Object
This method is used to create a channel.
28 29 30 31 32 |
# File 'lib/slack/endpoint/channels.rb', line 28 def channels_create(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.create", ) end |
#channels_history(options = {}) ⇒ Object
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.
54 55 56 57 58 |
# File 'lib/slack/endpoint/channels.rb', line 54 def channels_history(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.history", ) end |
#channels_info(options = {}) ⇒ Object
This method returns information about a team channel.
68 69 70 71 72 |
# File 'lib/slack/endpoint/channels.rb', line 68 def channels_info(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.info", ) end |
#channels_invite(options = {}) ⇒ Object
This method is used to invite a user to a channel. The calling user must be a member of the channel.
84 85 86 87 88 89 |
# File 'lib/slack/endpoint/channels.rb', line 84 def channels_invite(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :user missing") if [:user].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.invite", ) end |
#channels_join(options = {}) ⇒ Object
This method is used to join a channel. If the channel does not exist, it is created.
100 101 102 103 104 |
# File 'lib/slack/endpoint/channels.rb', line 100 def channels_join(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.join", ) end |
#channels_kick(options = {}) ⇒ Object
This method allows a user to remove another member from a team channel.
116 117 118 119 120 121 |
# File 'lib/slack/endpoint/channels.rb', line 116 def channels_kick(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :user missing") if [:user].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.kick", ) end |
#channels_leave(options = {}) ⇒ Object
This method is used to leave a channel.
131 132 133 134 135 |
# File 'lib/slack/endpoint/channels.rb', line 131 def channels_leave(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.leave", ) end |
#channels_list(options = {}) ⇒ Object
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.
147 148 149 150 |
# File 'lib/slack/endpoint/channels.rb', line 147 def channels_list(={}) [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.list", ) end |
#channels_mark(options = {}) ⇒ Object
This method moves the read cursor in a channel.
162 163 164 165 166 167 |
# File 'lib/slack/endpoint/channels.rb', line 162 def channels_mark(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.mark", ) end |
#channels_rename(options = {}) ⇒ Object
This method renames a team channel.
179 180 181 182 183 184 |
# File 'lib/slack/endpoint/channels.rb', line 179 def channels_rename(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :name missing") if [:name].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.rename", ) end |
#channels_setPurpose(options = {}) ⇒ Object
This method is used to change the purpose of a channel. The calling user must be a member of the channel.
196 197 198 199 200 201 |
# File 'lib/slack/endpoint/channels.rb', line 196 def channels_setPurpose(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :purpose missing") if [:purpose].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.setPurpose", ) end |
#channels_setTopic(options = {}) ⇒ Object
This method is used to change the topic of a channel. The calling user must be a member of the channel.
213 214 215 216 217 218 |
# File 'lib/slack/endpoint/channels.rb', line 213 def channels_setTopic(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :topic missing") if [:topic].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.setTopic", ) end |
#channels_unarchive(options = {}) ⇒ Object
This method unarchives a channel. The calling user is added to the channel.
228 229 230 231 232 |
# File 'lib/slack/endpoint/channels.rb', line 228 def channels_unarchive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("channels.unarchive", ) end |