From c1975d6a915be5a89bb5f3480116a79644d39ba7 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 27 Oct 2019 21:31:06 -0400 Subject: [PATCH] attempt to fix RichEmbed --- src/class/RichEmbed.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/class/RichEmbed.ts b/src/class/RichEmbed.ts index 38dbfec..e88e3e0 100644 --- a/src/class/RichEmbed.ts +++ b/src/class/RichEmbed.ts @@ -33,16 +33,24 @@ export default class RichEmbed { thumbnail?: { url?: string, proxy_url?: string, height?: number, width?: number }, video?: { url?: string, height?: number, width?: number }, provider?: { name?: string, url?: string}, author?: { name?: string, url?: string, proxy_icon_url?: string, icon_url?: string}, } = {}) { + /* let types: { title?: string, type?: string, description?: string, url?: string, timestamp?: Date, color?: number, fields?: {name: string, value: string, inline?: boolean}[] footer?: { text: string, icon_url?: string, proxy_icon_url?: string}, image?: { url?: string, proxy_url?: string, height?: number, width?: number }, thumbnail?: { url?: string, proxy_url?: string, height?: number, width?: number }, video?: { url?: string, height?: number, width?: number }, provider?: { name?: string, url?: string}, author?: { name?: string, url?: string, proxy_icon_url?: string, icon_url?: string} }; - this.fields = []; - for (const key of Object.keys(types)) { - if (data[key]) this[key] = data[key]; - } + */ + this.title = data.title; + this.description = data.description; + this.url = data.url; + this.color = data.color; + this.author = data.author; + this.timestamp = data.timestamp; + this.fields = data.fields || []; + this.thumbnail = data.thumbnail; + this.image = data.image; + this.footer = data.footer; } /**