Class: Line::Bot::Message::Audio

Inherits:
Base
  • Object
show all
Defined in:
lib/line/bot/message/audio.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs, #recipient_type

Instance Method Summary collapse

Methods inherited from Base

#[], #event_type, #initialize

Constructor Details

This class inherits a constructor from Line::Bot::Message::Base

Instance Method Details

#contentObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/line/bot/message/audio.rb', line 8

def content
  {
    contentType: ContentType::AUDIO,
    toType: recipient_type,
    originalContentUrl: attrs[:audio_url],
    contentMetadata: {
      AUDLEN: attrs[:duration].to_s,
    },
  }
end

#valid?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/line/bot/message/audio.rb', line 19

def valid?
  attrs[:audio_url] && attrs[:duration]
end