From 7006f00ae4f2c9e23ec4f31bf2d1de9ae4c98b90 Mon Sep 17 00:00:00 2001 From: Linn Dahlgren Date: Sun, 24 Feb 2019 09:27:57 +0100 Subject: [PATCH] feat(MessageEmbed): add missing proxyURL property to video (#3109) * Added missing property to MessageEmbed.video * Updated typings for MessageEmbed.video --- src/structures/MessageEmbed.js | 8 +++++++- typings/index.d.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 0b630cc68..8276cad77 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -100,11 +100,17 @@ class MessageEmbed { * The video of this embed (if there is one) * @type {?Object} * @property {string} url URL of this video + * @property {string} proxyURL ProxyURL for this video * @property {number} height Height of this video * @property {number} width Width of this video * @readonly */ - this.video = data.video; + this.video = data.video ? { + url: data.video.url, + proxyURL: data.video.proxy_url, + height: data.video.height, + width: data.video.width, + } : null; /** * The author of this embed (if there is one) diff --git a/typings/index.d.ts b/typings/index.d.ts index 6ac87dbb2..9a306de85 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -713,7 +713,7 @@ declare module 'discord.js' { public title: string; public type: string; public url: string; - public readonly video: { url?: string; height?: number; width?: number }; + public readonly video: { url?: string; proxyURL?: string; height?: number; width?: number }; public addBlankField(inline?: boolean): this; public addField(name: StringResolvable, value: StringResolvable, inline?: boolean): this; public attachFiles(file: (MessageAttachment | FileOptions | string)[]): this;