Skip to content

Instantly share code, notes, and snippets.

@phenomnomnominal
Created August 25, 2020 12:56
Show Gist options
  • Save phenomnomnominal/43bf0b7e9dda592472f6f0ce640fc8d1 to your computer and use it in GitHub Desktop.
Save phenomnomnominal/43bf0b7e9dda592472f6f0ce640fc8d1 to your computer and use it in GitHub Desktop.
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