Module: Slack::Endpoint::Chat
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/chat.rb
Instance Method Summary collapse
-
#chat_delete(options = {}) ⇒ Object
This method deletes a message from a channel.
-
#chat_postMessage(options = {}) ⇒ Object
This method posts a message to a public channel, private group, or IM channel.
-
#chat_update(options = {}) ⇒ Object
This method updates a message in a channel.
Instance Method Details
#chat_delete(options = {}) ⇒ Object
This method deletes a message from a channel.
18 19 20 21 22 23 |
# File 'lib/slack/endpoint/chat.rb', line 18 def chat_delete(={}) throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("chat.delete", ) end |
#chat_postMessage(options = {}) ⇒ Object
This method posts a message to a public channel, private group, or IM channel.
53 54 55 56 57 58 |
# File 'lib/slack/endpoint/chat.rb', line 53 def chat_postMessage(={}) throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text missing") if [:text].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("chat.postMessage", ) end |
#chat_update(options = {}) ⇒ Object
This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
80 81 82 83 84 85 86 |
# File 'lib/slack/endpoint/chat.rb', line 80 def chat_update(={}) throw ArgumentError.new("Required arguments :ts missing") if [:ts].nil? throw ArgumentError.new("Required arguments :channel missing") if [:channel].nil? throw ArgumentError.new("Required arguments :text missing") if [:text].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("chat.update", ) end |