Class: Discordrb::Components::MediaItem

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

Overview

Resolved metadata about a piece of media.

Instance Attribute Summary collapse

Instance Attribute Details

#attachment_idInteger? (readonly)

Returns the ID of the uploaded attachment. Only present when the media item was uploaded via an attachment://<filename> reference.

Returns:

  • (Integer, nil)

    the ID of the uploaded attachment. Only present when the media item was uploaded via an attachment://<filename> reference.



466
467
468
# File 'lib/discordrb/data/component.rb', line 466

def attachment_id
  @attachment_id
end

#content_typeString? (readonly)

Returns the content type of the media item.

Returns:

  • (String, nil)

    the content type of the media item.



462
463
464
# File 'lib/discordrb/data/component.rb', line 462

def content_type
  @content_type
end

#heightInteger? (readonly)

Returns the height of the media item.

Returns:

  • (Integer, nil)

    the height of the media item.



456
457
458
# File 'lib/discordrb/data/component.rb', line 456

def height
  @height
end

#proxy_urlString? (readonly)

Returns the proxied URL to the media item.

Returns:

  • (String, nil)

    the proxied URL to the media item.



459
460
461
# File 'lib/discordrb/data/component.rb', line 459

def proxy_url
  @proxy_url
end

#urlString (readonly)

Returns the URL to the media item.

Returns:

  • (String)

    the URL to the media item.



450
451
452
# File 'lib/discordrb/data/component.rb', line 450

def url
  @url
end

#widthInteger? (readonly)

Returns the width of the media item.

Returns:

  • (Integer, nil)

    the width of the media item.



453
454
455
# File 'lib/discordrb/data/component.rb', line 453

def width
  @width
end