mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2024-11-25 05:42:45 +01:00
Compare commits
2 Commits
a6dad6b4c7
...
67b9c12843
Author | SHA1 | Date | |
---|---|---|---|
67b9c12843 | |||
9030a2f010 |
@ -48,6 +48,16 @@ const STATE = (function() {
|
||||
});
|
||||
};
|
||||
|
||||
const getDate = function(date) {
|
||||
if (date instanceof Date) {
|
||||
return date;
|
||||
}
|
||||
else {
|
||||
// noinspection JSUnresolvedReference
|
||||
return date.toDate();
|
||||
}
|
||||
};
|
||||
|
||||
const trackingStateChangedListeners = [];
|
||||
let isTracking = false;
|
||||
|
||||
@ -69,8 +79,8 @@ const STATE = (function() {
|
||||
* @property {String} channel_id
|
||||
* @property {DiscordUser} author
|
||||
* @property {String} content
|
||||
* @property {Timestamp} timestamp
|
||||
* @property {Timestamp|null} editedTimestamp
|
||||
* @property {Date} timestamp
|
||||
* @property {Date|null} editedTimestamp
|
||||
* @property {DiscordAttachment[]} attachments
|
||||
* @property {Object[]} embeds
|
||||
* @property {DiscordMessageReaction[]} [reactions]
|
||||
@ -106,11 +116,6 @@ const STATE = (function() {
|
||||
* @property {Boolean} animated
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name Timestamp
|
||||
* @property {Function} toDate
|
||||
*/
|
||||
|
||||
return {
|
||||
setup(port, token) {
|
||||
serverPort = port;
|
||||
@ -223,12 +228,12 @@ const STATE = (function() {
|
||||
sender: msg.author.id,
|
||||
channel: msg.channel_id,
|
||||
text: msg.content,
|
||||
timestamp: msg.timestamp.toDate().getTime()
|
||||
timestamp: getDate(msg.timestamp).getTime()
|
||||
};
|
||||
|
||||
if (msg.editedTimestamp !== null) {
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
obj.editTimestamp = msg.editedTimestamp.toDate().getTime();
|
||||
obj.editTimestamp = getDate(msg.editedTimestamp).getTime();
|
||||
}
|
||||
|
||||
if (msg.messageReference !== null) {
|
||||
|
@ -8,5 +8,5 @@ using DHT.Utils;
|
||||
namespace DHT.Utils;
|
||||
|
||||
static class Version {
|
||||
public const string Tag = "41.0.0.0";
|
||||
public const string Tag = "41.1.0.0";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user