Sha256: a98bf674cf7a461bebcff29b3f248f5758d6c0ea8a0e0931e0608c6a453b8561

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

require 'json'

require_relative 'base'

module WaCloudApi
  module Message
    class Reaction < Base
      attr_accessor :message_id, :emoji

      def initialize(to:, message_id:, emoji:)
        @message_id = message_id
        @emoji = JSON.parse("\"#{emoji}\"").encode('utf-8')
        super(to: to, type: 'reaction')
      end

      private

      def request_params
        {
          messaging_product: messaging_product,
          recipient_type: recipient_type,
          to: to,
          type: type,
          "reaction": {
            "message_id": message_id,
            "emoji": emoji
          }
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wa_cloud_api-0.1.1 lib/wa_cloud_api/message/reaction.rb