Class: Rubirai::MusicShareMessage
- Defined in:
- lib/rubirai/messages/message.rb
Overview
The music share card message
Instance Attribute Summary collapse
-
#brief ⇒ String?
readonly
The brief message (optional).
-
#jump_url ⇒ String
readonly
The jump url.
-
#kind ⇒ String
readonly
The kind of music provider.
-
#music_url ⇒ String
readonly
The music's url.
-
#picture_url ⇒ String
readonly
The picture's url.
-
#summary ⇒ String
readonly
The music card summary.
-
#title ⇒ String
readonly
The music card title.
Attributes inherited from Message
Class Method Summary collapse
-
.all_kinds ⇒ Array<String>
List all kinds of music providers.
Methods inherited from Message
all_types, check_type, #to_h, to_message
Instance Attribute Details
#brief ⇒ String? (readonly)
Returns the brief message (optional).
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#jump_url ⇒ String (readonly)
Returns the jump url.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#kind ⇒ String (readonly)
Returns the kind of music provider.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#music_url ⇒ String (readonly)
Returns the music's url.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#picture_url ⇒ String (readonly)
Returns the picture's url.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#summary ⇒ String (readonly)
Returns the music card summary.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
#title ⇒ String (readonly)
Returns the music card title.
513 514 515 |
# File 'lib/rubirai/messages/message.rb', line 513 :MusicShare, :kind, :title, :summary, :jump_url, :picture_url, :music_url, :brief do |hash| raise(RubiraiError, 'non valid music type') unless all_kinds.include? hash['kind'] end |
Class Method Details
.all_kinds ⇒ Array<String>
List all kinds of music providers
495 496 497 |
# File 'lib/rubirai/messages/message.rb', line 495 def self.all_kinds %w[NeteaseCloudMusic QQMusic MiguMusic] end |