mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-15 23:02:13 +03:00
parent
8c68438fbb
commit
7e7d140957
@ -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"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user