Module: Slack::Endpoint::Chat
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/chat.rb
Instance Method Summary collapse
-
#chat_delete(options = {}) ⇒ Object
Deletes a message.
-
#chat_getPermalink(options = {}) ⇒ Object
Retrieve a permalink URL for a specific extant message.
-
#chat_meMessage(options = {}) ⇒ Object
Share a me message into a channel.
-
#chat_postEphemeral(options = {}) ⇒ Object
Sends an ephemeral message to a user in a channel.
-
#chat_postMessage(options = {}) ⇒ Object
Sends a message to a channel.
-
#chat_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs.
-
#chat_update(options = {}) ⇒ Object
Updates a message.
Instance Method Details
#chat_delete(options = {}) ⇒ Object
Deletes a message.
18 19 20 21 22 |
# File 'lib/slack/endpoint/chat.rb', line 18 def chat_delete(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? post("chat.delete", ) end |
#chat_getPermalink(options = {}) ⇒ Object
Retrieve a permalink URL for a specific extant message
34 35 36 37 38 |
# File 'lib/slack/endpoint/chat.rb', line 34 def chat_getPermalink(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :message_ts missing") if [:message_ts].nil? post("chat.getPermalink", ) end |
#chat_meMessage(options = {}) ⇒ Object
Share a me message into a channel.
50 51 52 53 54 |
# File 'lib/slack/endpoint/chat.rb', line 50 def chat_meMessage(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text missing") if [:text].nil? post("chat.meMessage", ) end |
#chat_postEphemeral(options = {}) ⇒ Object
Sends an ephemeral message to a user in a channel.
76 77 78 79 80 81 82 |
# File 'lib/slack/endpoint/chat.rb', line 76 def chat_postEphemeral(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text missing") if [:text].nil? throw ArgumentError.new("Required arguments :user missing") if [:user].nil? [:attachments] = [:attachments].to_json if [:attachments].is_a?(Array) || [:attachments].is_a?(Hash) post("chat.postEphemeral", ) end |
#chat_postMessage(options = {}) ⇒ Object
Sends a message to a channel.
116 117 118 119 120 121 |
# File 'lib/slack/endpoint/chat.rb', line 116 def chat_postMessage(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text or :attachments missing") if [:text].nil? && [:attachments].nil? [:attachments] = [:attachments].to_json if [:attachments].is_a?(Array) || [:attachments].is_a?(Hash) post("chat.postMessage", ) end |
#chat_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs
141 142 143 144 145 146 |
# File 'lib/slack/endpoint/chat.rb', line 141 def chat_unfurl(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? throw ArgumentError.new("Required arguments :unfurls missing") if [:unfurls].nil? post("chat.unfurl", ) end |
#chat_update(options = {}) ⇒ Object
Updates a message.
168 169 170 171 172 173 174 |
# File 'lib/slack/endpoint/chat.rb', line 168 def chat_update(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text missing") if [:text].nil? throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? [:attachments] = [:attachments].to_json if [:attachments].is_a?(Array) || [:attachments].is_a?(Hash) post("chat.update", ) end |