class Line::Bot::V2::Webhook::StickerMessageContent
@see developers.line.biz/en/reference/messaging-api/#wh-sticker
Attributes
@!attribute [rw] id
@return [String] Message ID
@!attribute [rw] keywords
@return [Array[String],nil] Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker.
@!attribute [rw] package_id
@return [String] Package ID
@!attribute [rw] quote_token
@return [String] Quote token to quote this message.
@!attribute [rw] quoted_message_id
@return [String,nil] Message ID of a quoted message. Only included when the received message quotes a past message.
@!attribute [rw] sticker_id
@return [String] Sticker ID
@!attribute [rw] sticker_resource_type
@return [String] ('STATIC'|'ANIMATION'|'SOUND'|'ANIMATION_SOUND'|'POPUP'|'POPUP_SOUND'|'CUSTOM'|'MESSAGE'|'NAME_TEXT'|'PER_STICKER_TEXT')
@!attribute [rw] text
@return [String,nil] Any text entered by the user. This property is only included for message stickers. Max character limit: 100
@!attribute [r] type
@return [String] Type
Public Class Methods
Source
# File lib/line/bot/v2/webhook/model/sticker_message_content.rb, line 92 def self.create(args) # steep:ignore symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args) return new(**symbolized_args) # steep:ignore end
Create an instance of the class from a hash @param args [Hash] Hash containing all the required attributes @return [Line::Bot::V2::Webhook::StickerMessageContent] Instance of the class
Source
# File lib/line/bot/v2/webhook/model/sticker_message_content.rb, line 54 def initialize( id:, package_id:, sticker_id:, sticker_resource_type:, keywords: nil, text: nil, quote_token:, quoted_message_id: nil, **dynamic_attributes ) @type = "sticker" @id = id @package_id = package_id @sticker_id = sticker_id @sticker_resource_type = sticker_resource_type @keywords = keywords @text = text @quote_token = quote_token @quoted_message_id = quoted_message_id dynamic_attributes.each do |key, value| self.class.attr_accessor key if value.is_a?(Hash) struct_klass = Struct.new(*value.keys.map(&:to_sym)) struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v } instance_variable_set("@#{key}", struct_klass.new(*struct_values)) else instance_variable_set("@#{key}", value) end end end
@param id [String] Message ID @param package_id
[String] Package ID @param sticker_id
[String] Sticker ID @param sticker_resource_type
[String] (‘STATIC’|‘ANIMATION’|‘SOUND’|‘ANIMATION_SOUND’|‘POPUP’|‘POPUP_SOUND’|‘CUSTOM’|‘MESSAGE’|‘NAME_TEXT’|‘PER_STICKER_TEXT’) @param keywords [Array,nil] Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. @param text [String,nil] Any text entered by the user. This property is only included for message stickers. Max character limit: 100 @param quote_token
[String] Quote token to quote this message. @param quoted_message_id
[String,nil] Message ID of a quoted message. Only included when the received message quotes a past message.
Public Instance Methods
Source
# File lib/line/bot/v2/webhook/model/sticker_message_content.rb, line 99 def ==(other) return false unless self.class == other.class instance_variables.all? do |var| instance_variable_get(var) == other.instance_variable_get(var) end end
@param other [Object] Object to compare @return [Boolean] true if the objects are equal, false otherwise
Source
# File lib/line/bot/v2/webhook/model/sticker_message_content.rb, line 108 def hash [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash end
@return [Integer] Hash code of the object