Created
August 25, 2020 12:56
-
-
Save phenomnomnominal/43bf0b7e9dda592472f6f0ce640fc8d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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