1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2024-10-19 05:42:50 +02:00

Compare commits

..

No commits in common. "5277f2831852f7bf1b7e4d8b593a9d427a399016" and "af48bf60ce30fda95680b07936705be8fff4daf0" have entirely different histories.

5 changed files with 10 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Discord History Tracker // @name Discord History Tracker
// @version v.31h // @version v.31g
// @license MIT // @license MIT
// @namespace https://chylex.com // @namespace https://chylex.com
// @homepageURL https://dht.chylex.com/ // @homepageURL https://dht.chylex.com/
@ -729,7 +729,7 @@ ${radio("asm", "pause", "Pause Tracking")}
${radio("asm", "switch", "Switch to Next Channel")} ${radio("asm", "switch", "Switch to Next Channel")}
<p id='dht-cfg-note'> <p id='dht-cfg-note'>
It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br> It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br>
<sub>v.31h, released 03 March 2024</sub> <sub>v.31g, released 25 December 2023</sub>
</p>`); </p>`);
// elements // elements
@ -900,16 +900,6 @@ class SAVEFILE{
return parsedObj && typeof parsedObj.meta === "object" && typeof parsedObj.data === "object"; 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){ findOrRegisterUser(userId, userName, userDiscriminator, userAvatar){
var wasPresent = userId in this.meta.users; var wasPresent = userId in this.meta.users;
var userObj = wasPresent ? this.meta.users[userId] : {}; var userObj = wasPresent ? this.meta.users[userId] : {};
@ -999,7 +989,7 @@ class SAVEFILE{
var obj = { var obj = {
u: this.findOrRegisterUser(author.id, author.username, author.bot ? null : author.discriminator, author.avatar), u: this.findOrRegisterUser(author.id, author.username, author.bot ? null : author.discriminator, author.avatar),
t: SAVEFILE.getDate(discordMessage.timestamp).getTime() t: discordMessage.timestamp.toDate().getTime()
}; };
if (discordMessage.content.length > 0){ if (discordMessage.content.length > 0){
@ -1007,7 +997,7 @@ class SAVEFILE{
} }
if (discordMessage.editedTimestamp !== null){ if (discordMessage.editedTimestamp !== null){
obj.te = SAVEFILE.getDate(discordMessage.editedTimestamp).getTime(); obj.te = discordMessage.editedTimestamp.toDate().getTime();
} }
if (discordMessage.embeds.length > 0){ 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 re
import distutils.dir_util import distutils.dir_util
VERSION_SHORT = "v.31h" VERSION_SHORT = "v.31g"
VERSION_FULL = VERSION_SHORT + ", released 03 March 2024" VERSION_FULL = VERSION_SHORT + ", released 25 December 2023"
EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --output \"{1}\" \"{0}\"" 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}\"" EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --output \"{1}\" \"{0}\""

View File

@ -114,16 +114,6 @@ class SAVEFILE{
return parsedObj && typeof parsedObj.meta === "object" && typeof parsedObj.data === "object"; 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){ findOrRegisterUser(userId, userName, userDiscriminator, userAvatar){
var wasPresent = userId in this.meta.users; var wasPresent = userId in this.meta.users;
var userObj = wasPresent ? this.meta.users[userId] : {}; var userObj = wasPresent ? this.meta.users[userId] : {};
@ -213,7 +203,7 @@ class SAVEFILE{
var obj = { var obj = {
u: this.findOrRegisterUser(author.id, author.username, author.bot ? null : author.discriminator, author.avatar), u: this.findOrRegisterUser(author.id, author.username, author.bot ? null : author.discriminator, author.avatar),
t: SAVEFILE.getDate(discordMessage.timestamp).getTime() t: discordMessage.timestamp.toDate().getTime()
}; };
if (discordMessage.content.length > 0){ if (discordMessage.content.length > 0){
@ -221,7 +211,7 @@ class SAVEFILE{
} }
if (discordMessage.editedTimestamp !== null){ if (discordMessage.editedTimestamp !== null){
obj.te = SAVEFILE.getDate(discordMessage.editedTimestamp).getTime(); obj.te = discordMessage.editedTimestamp.toDate().getTime();
} }
if (discordMessage.embeds.length > 0){ if (discordMessage.embeds.length > 0){