Skip to content

Instantly share code, notes, and snippets.

@tolzhabayev
Last active November 14, 2024 10:37
Show Gist options
  • Select an option

  • Save tolzhabayev/8865374f7aa328f2a0d9ab16ffa37b18 to your computer and use it in GitHub Desktop.

Select an option

Save tolzhabayev/8865374f7aa328f2a0d9ab16ffa37b18 to your computer and use it in GitHub Desktop.
const participants = new Set(
Array.from(document
.querySelectorAll('span.notranslate:not([class*=" "])'))
.map(item => item.textContent)
);
const shuffledParticipants = new Set(
Array.from(participants)
.sort(() => Math.random() - 0.5) // Randomly sort the array
);
setTimeout(() => {
const textArea = document.querySelector('textarea');
const send = document.querySelector('button[aria-label~="Send"]');
if (textArea && send) {
textArea.value = "Daily order:\n-----------------\n" + Array.from(shuffledParticipants).join('\n');
send.removeAttribute('disabled');
send.removeAttribute('aria-disabled');
send.click();
}
}, 300);
@tolzhabayev
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment