class Discordrb::Embed
An Embed
object that is contained in a message A freshly generated embed object will not appear in a message object unless grabbed from its ID in a channel.
Attributes
@return [String, nil] the color of the embed object. `nil` if there is not a color
@return [String, nil] the color of the embed object. `nil` if there is not a color
@return [String, nil] the description of the embed object. `nil` if there is not a description
@return [Array<EmbedField>, nil] the fields of the embed object. `nil` if there are no fields
@return [EmbedImage, nil] the image of the embed object. `nil` if there is not an image
@return [Message] the message this embed object is contained in.
@return [EmbedProvider, nil] the provider of the embed object. `nil` if there is not a provider
@return [EmbedThumbnail, nil] the thumbnail of the embed object. `nil` if there is not a thumbnail
@return [Time, nil] the timestamp of the embed object. `nil` if there is not a timestamp
@return [String, nil] the title of the embed object. `nil` if there is not a title
@return [Symbol] the type of the embed object. Possible types are:
* `:link` * `:video` * `:image`
@return [String] the URL this embed object is based on.
@return [EmbedVideo, nil] the video of the embed object. `nil` if there is not a video
Public Class Methods
@!visibility private
# File lib/discordrb/data.rb, line 2150 def initialize(data, message) @message = message @url = data['url'] @title = data['title'] @type = data['type'].to_sym @description = data['description'] @timestamp = data['timestamp'].nil? ? nil : Time.parse(data['timestamp']) @color = data['color'] @footer = data['footer'].nil? ? nil : EmbedFooter.new(data['footer'], self) @image = data['image'].nil? ? nil : EmbedImage.new(data['image'], self) @video = data['video'].nil? ? nil : EmbedVideo.new(data['video'], self) @provider = data['provider'].nil? ? nil : EmbedProvider.new(data['provider'], self) @thumbnail = data['thumbnail'].nil? ? nil : EmbedThumbnail.new(data['thumbnail'], self) @author = data['author'].nil? ? nil : EmbedAuthor.new(data['author'], self) @fields = data['fields'].nil? ? nil : data['fields'].map { |field| EmbedField.new(field, self) } end