Class: Discordrb::Embed

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data.rb

Overview

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.

Instance Attribute Summary collapse

Instance Attribute Details

#authorEmbedAuthor? (readonly)

Returns the author of the embed object. nil if there is not an author.

Returns:

  • (EmbedAuthor, nil)

    the author of the embed object. nil if there is not an author


1862
1863
1864
# File 'lib/discordrb/data.rb', line 1862

def author
  @author
end

#colorString? (readonly) Also known as: colour

Returns the color of the embed object. nil if there is not a color.

Returns:

  • (String, nil)

    the color of the embed object. nil if there is not a color


1843
1844
1845
# File 'lib/discordrb/data.rb', line 1843

def color
  @color
end

#descriptionString? (readonly)

Returns the description of the embed object. nil if there is not a description.

Returns:

  • (String, nil)

    the description of the embed object. nil if there is not a description


1830
1831
1832
# File 'lib/discordrb/data.rb', line 1830

def description
  @description
end

#fieldsArray<EmbedField>? (readonly)

Returns the fields of the embed object. nil if there are no fields.

Returns:

  • (Array<EmbedField>, nil)

    the fields of the embed object. nil if there are no fields


1865
1866
1867
# File 'lib/discordrb/data.rb', line 1865

def fields
  @fields
end

Returns the footer of the embed object. nil if there is not a footer.

Returns:

  • (EmbedFooter, nil)

    the footer of the embed object. nil if there is not a footer


1847
1848
1849
# File 'lib/discordrb/data.rb', line 1847

def footer
  @footer
end

#imageEmbedImage? (readonly)

Returns the image of the embed object. nil if there is not an image.

Returns:

  • (EmbedImage, nil)

    the image of the embed object. nil if there is not an image


1853
1854
1855
# File 'lib/discordrb/data.rb', line 1853

def image
  @image
end

#messageMessage (readonly)

Returns the message this embed object is contained in.

Returns:

  • (Message)

    the message this embed object is contained in.


1821
1822
1823
# File 'lib/discordrb/data.rb', line 1821

def message
  @message
end

#providerEmbedProvider? (readonly)

Returns the provider of the embed object. nil if there is not a provider.

Returns:

  • (EmbedProvider, nil)

    the provider of the embed object. nil if there is not a provider


1850
1851
1852
# File 'lib/discordrb/data.rb', line 1850

def provider
  @provider
end

#thumbnailEmbedThumbnail? (readonly)

Returns the thumbnail of the embed object. nil if there is not a thumbnail.

Returns:

  • (EmbedThumbnail, nil)

    the thumbnail of the embed object. nil if there is not a thumbnail


1856
1857
1858
# File 'lib/discordrb/data.rb', line 1856

def thumbnail
  @thumbnail
end

#timestampTime? (readonly)

Returns the timestamp of the embed object. nil if there is not a timestamp.

Returns:

  • (Time, nil)

    the timestamp of the embed object. nil if there is not a timestamp


1840
1841
1842
# File 'lib/discordrb/data.rb', line 1840

def timestamp
  @timestamp
end

#titleString? (readonly)

Returns the title of the embed object. nil if there is not a title.

Returns:

  • (String, nil)

    the title of the embed object. nil if there is not a title


1827
1828
1829
# File 'lib/discordrb/data.rb', line 1827

def title
  @title
end

#typeSymbol (readonly)

Returns the type of the embed object. Possible types are:

  • :link
  • :video
  • :image.

Returns:

  • (Symbol)

    the type of the embed object. Possible types are:

    • :link
    • :video
    • :image

1837
1838
1839
# File 'lib/discordrb/data.rb', line 1837

def type
  @type
end

#urlString (readonly)

Returns the URL this embed object is based on.

Returns:

  • (String)

    the URL this embed object is based on.


1824
1825
1826
# File 'lib/discordrb/data.rb', line 1824

def url
  @url
end

#videoEmbedVideo? (readonly)

Returns the video of the embed object. nil if there is not a video.

Returns:

  • (EmbedVideo, nil)

    the video of the embed object. nil if there is not a video


1859
1860
1861
# File 'lib/discordrb/data.rb', line 1859

def video
  @video
end