mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
refactor!: remove AttachmentBuilder and support new file body encodables (#11278)
BREAKING CHANGE: Remove AttachmentBuilder --------- Co-authored-by: Vlad Frangu <me@vladfrangu.dev> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5888663392
commit
9005c8ae9c
@@ -28,6 +28,11 @@ export class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
|
||||
* Creates a new attachment builder.
|
||||
*
|
||||
* @param data - The API data to create this attachment with
|
||||
* @example
|
||||
* ```ts
|
||||
* const attachment = new AttachmentBuilder().setId(1).setFileData(':)').setFilename('smiley.txt')
|
||||
* ```
|
||||
* @remarks Please note that the `id` field is required, it's rather easy to miss!
|
||||
*/
|
||||
public constructor(data: Partial<RESTAPIAttachment> = {}) {
|
||||
this.data = structuredClone(data);
|
||||
|
||||
Reference in New Issue
Block a user