Skip to content

Commit

Permalink
feat(Attachment): add title (#10423)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
sdanialraza and kodiakhq[bot] authored Aug 19, 2024
1 parent 2ca187b commit c63bde9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/discord.js/src/structures/Attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ class Attachment {
} else {
this.flags ??= new AttachmentFlagsBitField().freeze();
}

if ('title' in data) {
/**
* The title of this attachment
* <info>This will only be available if the attachment name contains special characters.</info>
* @type {?string}
*/
this.title = data.title;
} else {
this.title ??= null;
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2187,6 +2187,7 @@ export class Attachment {
public proxyURL: string;
public size: number;
public get spoiler(): boolean;
public title: string | null;
public url: string;
public waveform: string | null;
public width: number | null;
Expand Down

0 comments on commit c63bde9

Please sign in to comment.