From 9bc1576fc7e4856e25a01c352b4a7c27bbe16b90 Mon Sep 17 00:00:00 2001 From: Bsian Date: Sun, 17 May 2020 00:36:36 +0100 Subject: [PATCH] Use eris interface --- src/class/RichEmbed.ts | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/class/RichEmbed.ts b/src/class/RichEmbed.ts index 691f572..7df2ec0 100644 --- a/src/class/RichEmbed.ts +++ b/src/class/RichEmbed.ts @@ -1,20 +1,8 @@ /* eslint-disable no-param-reassign */ -export interface EmbedData { - title?: string - description?: string - url?: string - timestamp?: Date - color?: number - 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 } - author?: { name: string, url?: string, proxy_icon_url?: string, icon_url?: string} - fields?: {name: string, value: string, inline?: boolean}[] -} +import { EmbedOptions } from 'eris'; -export default class RichEmbed implements EmbedData { +export default class RichEmbed implements EmbedOptions { title?: string type?: string @@ -23,15 +11,15 @@ export default class RichEmbed implements EmbedData { url?: string - timestamp?: Date + timestamp?: string | Date color?: number footer?: { text: string, icon_url?: string, proxy_icon_url?: string} - image?: { url: string, proxy_url?: string, height?: number, width?: number } + image?: { url?: string, proxy_url?: string, height?: number, width?: number } - thumbnail?: { 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 } @@ -41,7 +29,7 @@ export default class RichEmbed implements EmbedData { fields?: {name: string, value: string, inline?: boolean}[] - constructor(data: EmbedData = {}) { + constructor(data: EmbedOptions = {}) { /* let types: { title?: string, type?: string, description?: string, url?: string, timestamp?: Date, color?: number, fields?: {name: string, value: string, inline?: boolean}[]