Class: Discordrb::Webhooks::View::FileBuilder

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

Overview

A file component lets you send a file via an attachment:// reference.

Instance Method Summary collapse

Constructor Details

#initialize(url:, id: nil, spoiler: false) ⇒ FileBuilder

Create a file component.

Parameters:

  • url (String)

    An attachment://<filename> reference to the attached file.

  • id (Integer, nil) (defaults to: nil)

    The unique 32-bit ID of the file component.

  • spoiler (true, false) (defaults to: false)

    Whether or not to apply a spoiler label to the file.



248
249
250
251
252
# File 'lib/discordrb/webhooks/view.rb', line 248

def initialize(url:, id: nil, spoiler: false)
  @id = id
  @file = { url: }
  @spoiler = spoiler
end