Release v.31h

This commit is contained in:
chylex 2024-03-03 14:16:57 +01:00
parent 515825f7a4
commit 5277f28318
No known key found for this signature in database
GPG Key ID: 4DE42C8F19A80548
4 changed files with 18 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Discord History Tracker
// @version v.31g
// @version v.31h
// @license MIT
// @namespace https://chylex.com
// @homepageURL https://dht.chylex.com/
@ -729,7 +729,7 @@ ${radio("asm", "pause", "Pause Tracking")}
${radio("asm", "switch", "Switch to Next Channel")}
<p id='dht-cfg-note'>
It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br>
<sub>v.31g, released 25 December 2023</sub>
<sub>v.31h, released 03 March 2024</sub>
</p>`);
// elements
@ -899,6 +899,16 @@ class SAVEFILE{
static isValid(parsedObj){
return parsedObj && typeof parsedObj.meta === "object" && typeof parsedObj.data === "object";
}
static getDate(date){
if (date instanceof Date) {
return date;
}
else {
// noinspection JSUnresolvedReference
return date.toDate();
}
};
findOrRegisterUser(userId, userName, userDiscriminator, userAvatar){
var wasPresent = userId in this.meta.users;
@ -989,7 +999,7 @@ class SAVEFILE{
var obj = {
u: this.findOrRegisterUser(author.id, author.username, author.bot ? null : author.discriminator, author.avatar),
t: discordMessage.timestamp.toDate().getTime()
t: SAVEFILE.getDate(discordMessage.timestamp).getTime()
};
if (discordMessage.content.length > 0){
@ -997,7 +1007,7 @@ class SAVEFILE{
}
if (discordMessage.editedTimestamp !== null){
obj.te = discordMessage.editedTimestamp.toDate().getTime();
obj.te = SAVEFILE.getDate(discordMessage.editedTimestamp).getTime();
}
if (discordMessage.embeds.length > 0){

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,8 @@ import os
import re
import distutils.dir_util
VERSION_SHORT = "v.31g"
VERSION_FULL = VERSION_SHORT + ", released 25 December 2023"
VERSION_SHORT = "v.31h"
VERSION_FULL = VERSION_SHORT + ", released 03 March 2024"
EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --output \"{1}\" \"{0}\""
EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --output \"{1}\" \"{0}\""