Fixing MessageEmbed's timestamp transforming (#1688)

when sending to discord
Also storing the timestamp in milliseconds when using setTimestamp
This commit is contained in:
SpaceEEC
2017-07-16 17:55:51 +02:00
committed by Crawl
parent b7bbd395e8
commit fdb8f046b5

View File

@@ -260,7 +260,7 @@ class MessageEmbed {
* @returns {MessageEmbed} This embed
*/
setTimestamp(timestamp = new Date()) {
this.timestamp = timestamp;
this.timestamp = timestamp.getTime();
return this;
}
@@ -292,7 +292,7 @@ class MessageEmbed {
type: 'rich',
description: this.description,
url: this.url,
timestamp: this.timestamp,
timestamp: this.timestamp ? new Date(this.timestamp) : null,
color: this.color,
fields: this.fields,
files: this.files,