Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
async function setLotsOfReminders(name, reminder, times) {
await Promise.all(Array.from({ length: times }, (_, i) => i + 1).reduce(async (p, days) => {
await p;
document.querySelector('[role="textbox"]').innerHTML = `remind @${name} to ${reminder} in ${days} days at 4am`;
return new Promise(resolve => {
setTimeout(() => {
document.querySelector('button[aria-label="Send message"]').click();
setTimeout(resolve, 1000);
}, 1000);
});
}, Promise.resolve()));
}
setLotsOfReminders('sentreh', 'do the thing', 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment