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

Compare commits

..

2 Commits

Author SHA1 Message Date
4db8c302d8
Release v37.2 2022-10-07 14:40:37 +02:00
7e7d140957
Fix server name detection after a Discord update
Closes #204
2022-10-07 14:35:30 +02:00
2 changed files with 16 additions and 3 deletions

View File

@ -197,9 +197,22 @@ class DISCORD {
return { server, channel }; return { server, channel };
} }
else if (obj.guild_id) { else if (obj.guild_id) {
let guild;
for (const child of DOM.getReactProps(document.querySelector("nav header [class*='headerContent-']")).children) {
if (child && child.props && child.props.guild) {
guild = child.props.guild;
break;
}
}
if (!guild || typeof guild.name !== "string" || obj.guild_id !== guild.id) {
return null;
}
const server = { const server = {
"id": obj.guild_id, "id": guild.id,
"name": document.querySelector("nav header h1[class*='name-']").innerText, "name": guild.name,
"type": "SERVER" "type": "SERVER"
}; };

View File

@ -7,6 +7,6 @@ using DHT.Utils;
namespace DHT.Utils { namespace DHT.Utils {
static class Version { static class Version {
public const string Tag = "37.1.0.0"; public const string Tag = "37.2.0.0";
} }
} }