Sha256: c493e505e23c5c3fc213f181ca925c2d7ebdf27c3adf042a17aeb002e6ae67bf

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

module Slack
  module API
    class Chat < Base
      def create(text, channel, options={})
        response = request :post, 'chat.postMessage', { text: text, channel: channel }.merge(options)
        Slack::Chat.parse response, 'message'
      end

      def delete(channel, timestamp)
        with_nil_response { request :post, 'chat.delete', ts: timestamp, channel: channel }
      end

      def update(text, channel, timestamp, options={})
        response = request :post, 'chat.update',
          { text: text, channel: channel, ts: timestamp }.merge(options)
        Slack::Chat.parse response, 'message'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
laziness-0.2.0 lib/laziness/api/chat.rb
laziness-0.1.9 lib/laziness/api/chat.rb
laziness-0.1.8 lib/laziness/api/chat.rb
laziness-0.1.7 lib/laziness/api/chat.rb