diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 2d0208b24..5d2b2066f 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -267,11 +267,12 @@ class MessageEmbed { /** * Sets the timestamp of this embed. - * @param {Date} [timestamp=current date] The timestamp + * @param {Date|number} [timestamp=Date.now()] The timestamp or date * @returns {MessageEmbed} */ - setTimestamp(timestamp = new Date()) { - this.timestamp = timestamp.getTime(); + 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 ad9baa67e..8e66679b7 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -741,7 +741,7 @@ declare module 'discord.js' { public setFooter(text: StringResolvable, iconURL?: 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; public toJSON(): object;