mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03: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 {
|
} else {
|
||||||
this.flags ??= new AttachmentFlagsBitField().freeze();
|
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 proxyURL: string;
|
||||||
public size: number;
|
public size: number;
|
||||||
public get spoiler(): boolean;
|
public get spoiler(): boolean;
|
||||||
|
public title: string | null;
|
||||||
public url: string;
|
public url: string;
|
||||||
public waveform: string | null;
|
public waveform: string | null;
|
||||||
public width: number | null;
|
public width: number | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user