Class: Discordrb::Components::File

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

Overview

A component that allows you to display an attachment.

Instance Attribute Summary collapse

Instance Attribute Details

#idInteger (readonly)

Returns the numeric identifier of the file.

Returns:

  • (Integer)

    the numeric identifier of the file.



419
420
421
# File 'lib/discordrb/data/component.rb', line 419

def id
  @id
end

#mediaMediaItem (readonly)

Returns the unfurled media item of the file.

Returns:

  • (MediaItem)

    the unfurled media item of the file.



429
430
431
# File 'lib/discordrb/data/component.rb', line 429

def media
  @media
end

#nameString (readonly)

Returns the name of the file that was uploaded.

Returns:

  • (String)

    the name of the file that was uploaded.



422
423
424
# File 'lib/discordrb/data/component.rb', line 422

def name
  @name
end

#sizeInteger (readonly)

Returns the size of the file that was uploaded in bytes.

Returns:

  • (Integer)

    the size of the file that was uploaded in bytes.



426
427
428
# File 'lib/discordrb/data/component.rb', line 426

def size
  @size
end

#spoilertrue, false (readonly) Also known as: spoiler?

Returns whether or not the file should be blurred out.

Returns:

  • (true, false)

    whether or not the file should be blurred out.



433
434
435
# File 'lib/discordrb/data/component.rb', line 433

def spoiler
  @spoiler
end