1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2024-11-25 14:42:44 +01:00

Compare commits

..

No commits in common. "67b9c1284367a6d9eaa648975d30fca2b3ec684f" and "a6dad6b4c79434d0f5dc92b72825a7d6557d9280" have entirely different histories.

2 changed files with 10 additions and 15 deletions

View File

@ -48,16 +48,6 @@ const STATE = (function() {
}); });
}; };
const getDate = function(date) {
if (date instanceof Date) {
return date;
}
else {
// noinspection JSUnresolvedReference
return date.toDate();
}
};
const trackingStateChangedListeners = []; const trackingStateChangedListeners = [];
let isTracking = false; let isTracking = false;
@ -79,8 +69,8 @@ const STATE = (function() {
* @property {String} channel_id * @property {String} channel_id
* @property {DiscordUser} author * @property {DiscordUser} author
* @property {String} content * @property {String} content
* @property {Date} timestamp * @property {Timestamp} timestamp
* @property {Date|null} editedTimestamp * @property {Timestamp|null} editedTimestamp
* @property {DiscordAttachment[]} attachments * @property {DiscordAttachment[]} attachments
* @property {Object[]} embeds * @property {Object[]} embeds
* @property {DiscordMessageReaction[]} [reactions] * @property {DiscordMessageReaction[]} [reactions]
@ -116,6 +106,11 @@ const STATE = (function() {
* @property {Boolean} animated * @property {Boolean} animated
*/ */
/**
* @name Timestamp
* @property {Function} toDate
*/
return { return {
setup(port, token) { setup(port, token) {
serverPort = port; serverPort = port;
@ -228,12 +223,12 @@ const STATE = (function() {
sender: msg.author.id, sender: msg.author.id,
channel: msg.channel_id, channel: msg.channel_id,
text: msg.content, text: msg.content,
timestamp: getDate(msg.timestamp).getTime() timestamp: msg.timestamp.toDate().getTime()
}; };
if (msg.editedTimestamp !== null) { if (msg.editedTimestamp !== null) {
// noinspection JSUnusedGlobalSymbols // noinspection JSUnusedGlobalSymbols
obj.editTimestamp = getDate(msg.editedTimestamp).getTime(); obj.editTimestamp = msg.editedTimestamp.toDate().getTime();
} }
if (msg.messageReference !== null) { if (msg.messageReference !== null) {

View File

@ -8,5 +8,5 @@ using DHT.Utils;
namespace DHT.Utils; namespace DHT.Utils;
static class Version { static class Version {
public const string Tag = "41.1.0.0"; public const string Tag = "41.0.0.0";
} }