mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-14 07:37:13 +03:00
parent
37640c97b0
commit
18f5823f2a
@ -9,7 +9,7 @@ class DISCORD {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getMessageElements() {
|
static getMessageElements() {
|
||||||
return this.getMessageOuterElement().querySelectorAll("[class*='message-']");
|
return this.getMessageOuterElement().querySelectorAll("[class*='message_']");
|
||||||
}
|
}
|
||||||
|
|
||||||
static hasMoreMessages() {
|
static hasMoreMessages() {
|
||||||
@ -168,7 +168,7 @@ class DISCORD {
|
|||||||
if (dms) {
|
if (dms) {
|
||||||
let name;
|
let name;
|
||||||
|
|
||||||
for (const ele of dms.querySelectorAll("[class*='channel-'] [class*='selected-'] [class^='name-'] *, [class*='channel-'][class*='selected-'] [class^='name-'] *")) {
|
for (const ele of dms.querySelectorAll("[class*='channel_'] [class*='selected_'] [class^='name_'] *")) {
|
||||||
const node = Array.prototype.find.call(ele.childNodes, node => node.nodeType === Node.TEXT_NODE);
|
const node = Array.prototype.find.call(ele.childNodes, node => node.nodeType === Node.TEXT_NODE);
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
@ -199,7 +199,7 @@ class DISCORD {
|
|||||||
else if (obj.guild_id) {
|
else if (obj.guild_id) {
|
||||||
let guild;
|
let guild;
|
||||||
|
|
||||||
for (const child of DOM.getReactProps(document.querySelector("nav header [class*='headerContent-']")).children) {
|
for (const child of DOM.getReactProps(document.querySelector("nav header [class*='headerContent_']")).children) {
|
||||||
if (child && child.props && child.props.guild) {
|
if (child && child.props && child.props.guild) {
|
||||||
guild = child.props.guild;
|
guild = child.props.guild;
|
||||||
break;
|
break;
|
||||||
@ -251,10 +251,10 @@ class DISCORD {
|
|||||||
|
|
||||||
if (dms) {
|
if (dms) {
|
||||||
const currentChannel = DOM.queryReactClass("selected", dms);
|
const currentChannel = DOM.queryReactClass("selected", dms);
|
||||||
const currentChannelContainer = currentChannel && currentChannel.closest("[class*='channel-']");
|
const currentChannelContainer = currentChannel && currentChannel.closest("[class*='channel_']");
|
||||||
const nextChannel = currentChannelContainer && currentChannelContainer.nextElementSibling;
|
const nextChannel = currentChannelContainer && currentChannelContainer.nextElementSibling;
|
||||||
|
|
||||||
if (!nextChannel || !nextChannel.getAttribute("class").includes("channel-")) {
|
if (!nextChannel || !nextChannel.getAttribute("class").includes("channel_")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ class DISCORD {
|
|||||||
let nextChannel = null;
|
let nextChannel = null;
|
||||||
|
|
||||||
for (let index = 0; index < allTextChannels.length - 1; index++) {
|
for (let index = 0; index < allTextChannels.length - 1; index++) {
|
||||||
if (allTextChannels[index].className.includes("selected-")) {
|
if (allTextChannels[index].className.includes("selected_")) {
|
||||||
nextChannel = allTextChannels[index + 1];
|
nextChannel = allTextChannels[index + 1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ class DOM {
|
|||||||
* Returns the first child element containing the specified obfuscated class. Parent defaults to the entire document.
|
* Returns the first child element containing the specified obfuscated class. Parent defaults to the entire document.
|
||||||
*/
|
*/
|
||||||
static queryReactClass(cls, parent) {
|
static queryReactClass(cls, parent) {
|
||||||
return (parent || document).querySelector(`[class*="${cls}-"]`);
|
return (parent || document).querySelector(`[class*="${cls}_"]`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user