From 6650d50a56c42aca9657b627d2333349bd05b181 Mon Sep 17 00:00:00 2001 From: Ryan Munro Date: Sun, 1 Mar 2020 00:21:43 +1100 Subject: [PATCH] =?UTF-8?q?feat(MessageEmbed):=20Support=20EmbedFieldData[?= =?UTF-8?q?]=20instead=20of=20EmbedFi=E2=80=A6=20(#3845)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: SpaceEEC --- src/structures/MessageEmbed.js | 2 +- typings/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 35e2ec2bf..905433e2d 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -65,7 +65,7 @@ class MessageEmbed { * The fields of this embed * @type {EmbedField[]} */ - this.fields = data.fields ? data.fields.map(Util.cloneObject) : []; + this.fields = data.fields ? this.constructor.normalizeFields(data.fields) : []; /** * @typedef {Object} MessageEmbedThumbnail diff --git a/typings/index.d.ts b/typings/index.d.ts index cac46ed04..ad02dc090 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2469,7 +2469,7 @@ declare module 'discord.js' { url?: string; timestamp?: Date | number; color?: ColorResolvable; - fields?: EmbedField[]; + fields?: EmbedFieldData[]; files?: (MessageAttachment | string | FileOptions)[]; author?: Partial & { icon_url?: string; proxy_icon_url?: string; }; thumbnail?: Partial & { proxy_url?: string; };