mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(Attachment): add title (#10423)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user