seyfert
Version:
The most advanced framework for discord bots
38 lines (37 loc) • 1.15 kB
TypeScript
import { type APIFileComponent } from '../types';
import { BaseComponentBuilder } from './Base';
/**
* Represents a file component builder.
* Used to display files within containers.
* @example
* ```ts
* const file = new File()
* .setMedia('https://example.com/image.png')
* .setSpoiler();
* ```
*/
export declare class File extends BaseComponentBuilder<APIFileComponent> {
/**
* Constructs a new File component.
* @param data Optional initial data for the file component.
*/
constructor(data?: Partial<APIFileComponent>);
/**
* Sets the ID for the file component.
* @param id The ID to set.
* @returns The updated File instance.
*/
setId(id: number): this;
/**
* Sets the media URL for the file.
* @param url The URL of the file to display.
* @returns The updated File instance.
*/
setMedia(url: string): this;
/**
* Sets whether the file should be visually marked as a spoiler.
* @param spoiler Whether the file is a spoiler (defaults to true).
* @returns The updated File instance.
*/
setSpoiler(spoiler?: boolean): this;
}