// unarchive all threads in the current discord channel
// yes, it's soup. yes, it looks horrible. yes, it's slow.
// but it works, and i don't care right now.
let threads = document.querySelector('div[aria-label="Threads"]')
threads.click();
await new Promise(r => setTimeout(r, 1000));
document.querySelector('div[aria-controls="1-tab"]').click()
await new Promise(r => setTimeout(r, 1000));
let snap = document.evaluate('//div[@aria-modal="true"]' +
'//div[contains(@class, "content-")]' +
'/div[contains(@class, "container-")]', document, null, 6);
for (let i = 0; i < snap.snapshotLength; i++) {
let n = snap.snapshotItem(i);
n.__reactProps$.onContextMenu({ stopPropagation: () => {},
preventDefault: () => {}, currentTarget: n.parentNode,
target: n, pageX: 1, pageY: 1 });
await new Promise(r => setTimeout(r, 1000));
document.evaluate('//div[text()="Unarchive Thread"]', document)
.iterateNext().click();
}
threads.click();