diff --git a/src/structures/RichEmbed.js b/src/structures/RichEmbed.js index b1cb0b7f0..d8e16ccea 100644 --- a/src/structures/RichEmbed.js +++ b/src/structures/RichEmbed.js @@ -140,10 +140,11 @@ class RichEmbed { /** * Sets the timestamp of this embed. - * @param {Date} [timestamp=new Date()] The timestamp + * @param {Date|number} [timestamp=Date.now()] The timestamp or date * @returns {RichEmbed} This embed */ - setTimestamp(timestamp = new Date()) { + setTimestamp(timestamp = Date.now()) { + if (timestamp instanceof Date) timestamp = timestamp.getTime(); this.timestamp = timestamp; return this; } diff --git a/typings/index.d.ts b/typings/index.d.ts index c4676847f..4db2ee0b7 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1030,7 +1030,7 @@ declare module 'discord.js' { public setFooter(text: StringResolvable, icon?: string): this; public setImage(url: string): this; public setThumbnail(url: string): this; - public setTimestamp(timestamp?: Date): this; + public setTimestamp(timestamp?: Date | number): this; public setTitle(title: StringResolvable): this; public setURL(url: string): this; }