mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(MessageEmbed): Support EmbedFieldData[] instead of EmbedFi… (#3845)
* fix(typings): MessageEmbedOptions#fields should be EmbedFieldData[] * feat(MessageEmbed): Allow optional EmbedFieldData#inline in constructor * docs(MessageEmbed): revert type change of fields Co-authored-by: Crawl <icrawltogo@gmail.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -65,7 +65,7 @@ class MessageEmbed {
|
|||||||
* The fields of this embed
|
* The fields of this embed
|
||||||
* @type {EmbedField[]}
|
* @type {EmbedField[]}
|
||||||
*/
|
*/
|
||||||
this.fields = data.fields ? data.fields.map(Util.cloneObject) : [];
|
this.fields = data.fields ? this.constructor.normalizeFields(data.fields) : [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} MessageEmbedThumbnail
|
* @typedef {Object} MessageEmbedThumbnail
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -2469,7 +2469,7 @@ declare module 'discord.js' {
|
|||||||
url?: string;
|
url?: string;
|
||||||
timestamp?: Date | number;
|
timestamp?: Date | number;
|
||||||
color?: ColorResolvable;
|
color?: ColorResolvable;
|
||||||
fields?: EmbedField[];
|
fields?: EmbedFieldData[];
|
||||||
files?: (MessageAttachment | string | FileOptions)[];
|
files?: (MessageAttachment | string | FileOptions)[];
|
||||||
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string; };
|
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string; };
|
||||||
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string; };
|
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string; };
|
||||||
|
|||||||
Reference in New Issue
Block a user