feat(Attachment): add title

#10423 backport
This commit is contained in:
Elysia
2024-09-17 19:27:43 +07:00
parent e9adc0c20e
commit 93b4118145
2 changed files with 12 additions and 0 deletions

View File

@@ -181,6 +181,17 @@ class MessageAttachment {
} else { } else {
this.flags ??= new AttachmentFlags().freeze(); this.flags ??= new AttachmentFlags().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
typings/index.d.ts vendored
View File

@@ -2160,6 +2160,7 @@ export class MessageAttachment {
public proxyURL: string; public proxyURL: string;
public size: number; public size: number;
public readonly spoiler: boolean; public readonly 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;