Skip to content

Commit c63bde9

Browse files
feat(Attachment): add title (#10423)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 2ca187b commit c63bde9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/discord.js/src/structures/Attachment.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ class Attachment {
133133
} else {
134134
this.flags ??= new AttachmentFlagsBitField().freeze();
135135
}
136+
137+
if ('title' in data) {
138+
/**
139+
* The title of this attachment
140+
* <info>This will only be available if the attachment name contains special characters.</info>
141+
* @type {?string}
142+
*/
143+
this.title = data.title;
144+
} else {
145+
this.title ??= null;
146+
}
136147
}
137148

138149
/**

packages/discord.js/typings/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,7 @@ export class Attachment {
21872187
public proxyURL: string;
21882188
public size: number;
21892189
public get spoiler(): boolean;
2190+
public title: string | null;
21902191
public url: string;
21912192
public waveform: string | null;
21922193
public width: number | null;

0 commit comments

Comments
 (0)