Module: Slack::Endpoint::Groups
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/groups.rb
Instance Method Summary collapse
-
#groups_archive(options = {}) ⇒ Object
This method archives a private channel.
-
#groups_close(options = {}) ⇒ Object
This method closes a private channel.
-
#groups_create(options = {}) ⇒ Object
This method creates a private channel.
-
#groups_createChild(options = {}) ⇒ Object
This method takes an existing private channel and performs the following steps:.
-
#groups_history(options = {}) ⇒ Object
This method returns a portion of messages/events from the specified private channel.
-
#groups_info(options = {}) ⇒ Object
This method returns information about a private channel.
-
#groups_invite(options = {}) ⇒ Object
This method is used to invite a user to a private channel.
-
#groups_kick(options = {}) ⇒ Object
This method allows a user to remove another member from a private channel.
-
#groups_leave(options = {}) ⇒ Object
This method is used to leave a private channel.
-
#groups_list(options = {}) ⇒ Object
This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in.
-
#groups_mark(options = {}) ⇒ Object
This method moves the read cursor in a private channel.
-
#groups_open(options = {}) ⇒ Object
This method opens a private channel.
-
#groups_rename(options = {}) ⇒ Object
This method renames a private channel.
-
#groups_replies(options = {}) ⇒ Object
This method returns an entire thread (a message plus all the messages in reply to it).
-
#groups_setPurpose(options = {}) ⇒ Object
This method is used to change the purpose of a private channel.
-
#groups_setTopic(options = {}) ⇒ Object
This method is used to change the topic of a private channel.
-
#groups_unarchive(options = {}) ⇒ Object
This method unarchives a private channel.
Instance Method Details
#groups_archive(options = {}) ⇒ Object
This method archives a private channel.
14 15 16 17 18 |
# File 'lib/slack/endpoint/groups.rb', line 14 def groups_archive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.archive", ) end |
#groups_close(options = {}) ⇒ Object
This method closes a private channel.
28 29 30 31 32 |
# File 'lib/slack/endpoint/groups.rb', line 28 def groups_close(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.close", ) end |
#groups_create(options = {}) ⇒ Object
This method creates a private channel.
42 43 44 45 46 |
# File 'lib/slack/endpoint/groups.rb', line 42 def groups_create(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.create", ) end |
#groups_createChild(options = {}) ⇒ Object
This method takes an existing private channel and performs the following steps:
56 57 58 59 60 |
# File 'lib/slack/endpoint/groups.rb', line 56 def groups_createChild(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.createChild", ) end |
#groups_history(options = {}) ⇒ Object
This method returns a portion of messages/events from the specified private channel. To read the entire history for a private channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below.
82 83 84 85 86 |
# File 'lib/slack/endpoint/groups.rb', line 82 def groups_history(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.history", ) end |
#groups_info(options = {}) ⇒ Object
This method returns information about a private channel.
96 97 98 99 100 |
# File 'lib/slack/endpoint/groups.rb', line 96 def groups_info(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.info", ) end |
#groups_invite(options = {}) ⇒ Object
This method is used to invite a user to a private channel. The calling user must be a member of the private channel.
112 113 114 115 116 117 |
# File 'lib/slack/endpoint/groups.rb', line 112 def groups_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("groups.invite", ) end |
#groups_kick(options = {}) ⇒ Object
This method allows a user to remove another member from a private channel.
129 130 131 132 133 134 |
# File 'lib/slack/endpoint/groups.rb', line 129 def groups_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("groups.kick", ) end |
#groups_leave(options = {}) ⇒ Object
This method is used to leave a private channel.
144 145 146 147 148 |
# File 'lib/slack/endpoint/groups.rb', line 144 def groups_leave(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.leave", ) end |
#groups_list(options = {}) ⇒ Object
This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in. The list of (non-deactivated) members in each private channel is also returned.
159 160 161 162 |
# File 'lib/slack/endpoint/groups.rb', line 159 def groups_list(={}) [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.list", ) end |
#groups_mark(options = {}) ⇒ Object
This method moves the read cursor in a private channel.
174 175 176 177 178 179 |
# File 'lib/slack/endpoint/groups.rb', line 174 def groups_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("groups.mark", ) end |
#groups_open(options = {}) ⇒ Object
This method opens a private channel.
189 190 191 192 193 |
# File 'lib/slack/endpoint/groups.rb', line 189 def groups_open(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.open", ) end |
#groups_rename(options = {}) ⇒ Object
This method renames a private channel.
205 206 207 208 209 210 |
# File 'lib/slack/endpoint/groups.rb', line 205 def groups_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("groups.rename", ) end |
#groups_replies(options = {}) ⇒ Object
This method returns an entire thread (a message plus all the messages in reply to it).
222 223 224 225 226 227 |
# File 'lib/slack/endpoint/groups.rb', line 222 def groups_replies(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :thread_ts missing") if [:thread_ts].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.replies", ) end |
#groups_setPurpose(options = {}) ⇒ Object
This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.
239 240 241 242 243 244 |
# File 'lib/slack/endpoint/groups.rb', line 239 def groups_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("groups.setPurpose", ) end |
#groups_setTopic(options = {}) ⇒ Object
This method is used to change the topic of a private channel. The calling user must be a member of the private channel.
256 257 258 259 260 261 |
# File 'lib/slack/endpoint/groups.rb', line 256 def groups_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("groups.setTopic", ) end |
#groups_unarchive(options = {}) ⇒ Object
This method unarchives a private channel.
271 272 273 274 275 |
# File 'lib/slack/endpoint/groups.rb', line 271 def groups_unarchive(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("groups.unarchive", ) end |