bot
bot copied to clipboard
Button for others to opt-in to be notified for reminders
Closes #1327.
The bookmark command (Sir Lancebot) allows other people to click a button to receive a copy of a bookmark when someone bookmarks a message.
This PR adds a similar button for the !remind command, other people can click the button to add themselves to the mention list of the reminder. When the reminder arrives, they will be notified with a ping.
Demo
When the reminder is created, and someone clicks on the button:
When the reminder arrives, the person will be pinged along with the author and the button will be removed:
Implementation details
This is my first time using dpy 2.0 features, please do be pedantic with reviews if need be!
- I've tried to make it as resilient as possible. Edits/deletion of reminders in between button click and button creation will be handled appropriately. This comes with the tradeoff that requires at least 1 API hit for every button click.
- All logic and design related to this button is kept within the View class, minimal changes are put into the commands' code.
Other (less important) details can be found in the commit messages.
Design choices
- To simplify implementation, the button will timeout within 5 minutes of creation or when the reminder arrives, whichever comes first. If the reminder is edited to arrive before what is originally scheduled, the button will be disabled when someone tries to click on it after the reminder has already arrived.
- I couldn't find a good way to phrase the sentence that could concisely and professionally tell everyone that this button is for everyone other than the reminder's author, so I decided to list the reminder mentions upfront to make it clear what the button will do. In exchange the embed might be considered a little verbose (until the button times out).
Also, I haven't touched our dpy codebases (and dpy) in a long time, I'm quite happy to make modifications to comply with any best practices or prevailing styles we have that I hadn't noticed.