Skip to content

Add ability to delete multiple reminders at once & display mentions in !remind list.#2232

Merged
wookie184 merged 7 commits into
mainfrom
bot-2231-enhancements
Sep 21, 2022
Merged

Add ability to delete multiple reminders at once & display mentions in !remind list.#2232
wookie184 merged 7 commits into
mainfrom
bot-2231-enhancements

Conversation

@TizzySaurus
Copy link
Copy Markdown
Contributor

@TizzySaurus TizzySaurus commented Jul 25, 2022

Part 1 of #2231.

Delete Multiple Reminders
This has been tested with the help of @ichard26 (thanks!).

The behaviour behind the deletion is still the exact same (you can't delete others' reminders unless you're an admin), just has been reformatted to account for the fact that a lock needs to be applied to each individual id.

There's also some changes to prevent a message being sent for each deletion fail -- we instead send one message after processing all ids.

All reminders successfully deleted:
image

Some reminders successfully deleted:
image

No reminders were successfully deleted:
image

Display Mentions
!remind list will now display the .mention attribute, instead of the .name attribute to be clearer.

Before:
image

After:
image

@TizzySaurus TizzySaurus added a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) p: 3 - low Low Priority a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) t: enhancement Changes or improvements to existing features s: needs review Author is waiting for someone to review and approve labels Jul 25, 2022
@TizzySaurus TizzySaurus requested review from jb3 and ks129 as code owners July 25, 2022 21:34
Comment thread bot/exts/utils/reminders.py
- Convert `ids` to a set to remove duplicates
- Limit the amount of reminders you can delete at once to 5 in order to prevent API spam
Copy link
Copy Markdown
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@vivekashok1221 vivekashok1221 self-requested a review September 18, 2022 17:18
Copy link
Copy Markdown
Contributor

@vivekashok1221 vivekashok1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested.
LGTM 🌟 .

Comment thread bot/exts/utils/reminders.py Outdated
Added so that the user still gets information on what the mention is, when the mention doesn't render (due to client cache etc.)
@wookie184 wookie184 enabled auto-merge September 21, 2022 20:31
@wookie184 wookie184 merged commit 71fbd5a into main Sep 21, 2022
@wookie184 wookie184 deleted the bot-2231-enhancements branch September 21, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 3 - low Low Priority s: needs review Author is waiting for someone to review and approve t: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants