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 message events from the specified public 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_replies(options = {}) ⇒ Object
This method returns an entire thread (a message plus all the messages in reply to it).
-
#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 |
# 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
This method is used to create a channel.
29 30 31 32 |
# File 'lib/slack/endpoint/channels.rb', line 29 def channels_create(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? post("channels.create", ) end |
#channels_history(options = {}) ⇒ Object
This method returns a portion of message events from the specified public channel.
52 53 54 55 |
# File 'lib/slack/endpoint/channels.rb', line 52 def channels_history(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.history", ) end |
#channels_info(options = {}) ⇒ Object
This method returns information about a team channel.
65 66 67 68 |
# File 'lib/slack/endpoint/channels.rb', line 65 def channels_info(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? 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.
80 81 82 83 84 |
# File 'lib/slack/endpoint/channels.rb', line 80 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
This method is used to join a channel. If the channel does not exist, it is created.
97 98 99 100 |
# File 'lib/slack/endpoint/channels.rb', line 97 def channels_join(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? post("channels.join", ) end |
#channels_kick(options = {}) ⇒ Object
This method allows a user to remove another member from a team channel.
112 113 114 115 116 |
# File 'lib/slack/endpoint/channels.rb', line 112 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
This method is used to leave a channel.
126 127 128 129 |
# File 'lib/slack/endpoint/channels.rb', line 126 def channels_leave(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? 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 but does not include private channels. The number of (non-deactivated) members in each channel is also returned.
141 142 143 |
# File 'lib/slack/endpoint/channels.rb', line 141 def channels_list(={}) post("channels.list", ) end |
#channels_mark(options = {}) ⇒ Object
This method moves the read cursor in a channel.
155 156 157 158 159 |
# File 'lib/slack/endpoint/channels.rb', line 155 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
This method renames a team channel.
173 174 175 176 177 |
# File 'lib/slack/endpoint/channels.rb', line 173 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_replies(options = {}) ⇒ Object
This method returns an entire thread (a message plus all the messages in reply to it).
189 190 191 192 193 |
# File 'lib/slack/endpoint/channels.rb', line 189 def channels_replies(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :thread_ts missing") if [:thread_ts].nil? post("channels.replies", ) 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.
205 206 207 208 209 |
# File 'lib/slack/endpoint/channels.rb', line 205 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
This method is used to change the topic of a channel. The calling user must be a member of the channel.
221 222 223 224 225 |
# File 'lib/slack/endpoint/channels.rb', line 221 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
This method unarchives a channel. The calling user is added to the channel.
235 236 237 238 |
# File 'lib/slack/endpoint/channels.rb', line 235 def channels_unarchive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? post("channels.unarchive", ) end |