Module: Slack::Web::Api::Endpoints::Chat
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/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.
| 17 18 19 20 21 | # File 'lib/slack/web/api/endpoints/chat.rb', line 17 def chat_delete( = {}) throw ArgumentError.new('Required arguments :ts missing') if [:ts].nil? throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? post('chat.delete', ) end | 
#chat_postMessage(options = {}) ⇒ Object
This method posts a message to a public channel, private group, or IM channel.
| 50 51 52 53 54 55 56 57 58 59 60 | # File 'lib/slack/web/api/endpoints/chat.rb', line 50 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 must be passed as an encoded JSON string if .key?(:attachments) = [:attachments] = JSON.dump() unless .is_a?(String) = .merge(attachments: ) end post('chat.postMessage', ) end | 
#chat_update(options = {}) ⇒ Object
This method updates a message in a channel.
| 79 80 81 82 83 84 | # File 'lib/slack/web/api/endpoints/chat.rb', line 79 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? post('chat.update', ) end |