Module: Slack::Web::Chat
- Included in:
- Slack::Web
- Defined in:
- lib/slack/web/chat.rb
Overview
Module for the chat methods. Post chat messages to Slack.
Constant Summary collapse
- SCOPE =
Endpoint scope
"chat"
Instance Method Summary collapse
-
#chat_delete(params = {}) ⇒ Object
Deletes a message.
-
#chat_post_message(params = {}) ⇒ Object
Sends a message to a channel.
-
#chat_update(params = {}) ⇒ Object
Updates a message.
Instance Method Details
#chat_delete(params = {}) ⇒ Object
Deletes a message.
22 23 24 25 26 27 |
# File 'lib/slack/web/chat.rb', line 22 def chat_delete(params={}) raise ArgumentError.new("Required arguments 'ts' missing") if params['ts'].nil? raise ArgumentError.new("Required arguments 'channel' missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.delete", params Slack::parse_response(response) end |
#chat_post_message(params = {}) ⇒ Object
Sends a message to a channel.
57 58 59 60 61 62 |
# File 'lib/slack/web/chat.rb', line 57 def (params={}) raise ArgumentError.new("Required arguments 'channel' missing") if params['channel'].nil? raise ArgumentError.new("Required arguments 'text' missing") if params['text'].nil? response = @session.do_get "#{SCOPE}.postMessage", params Slack::parse_response(response) end |
#chat_update(params = {}) ⇒ Object
Updates a message.
76 77 78 79 80 81 82 |
# File 'lib/slack/web/chat.rb', line 76 def chat_update(params={}) raise ArgumentError.new("Required arguments 'ts' missing") if params['ts'].nil? raise ArgumentError.new("Required arguments 'channel' missing") if params['channel'].nil? raise ArgumentError.new("Required arguments 'text' missing") if params['text'].nil? response = @session.do_get "#{SCOPE}.update", params Slack::parse_response(response) end |