Help delete pages delay feature #3433
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!3433
Loading…
Reference in a new issue
No description provided.
Delete branch "help-delete-improvement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
This PR adds a feature that allows you to set a delay after which the help messages / pages will be deleted after using a help command. Disabled by default. Doesn't affect embed-menu-based help since that's handled differently. Doesn't delete when sending to DMs, nor does it delete the issued help command message itself. Handles code blocks and embed-based help. Uses bulk delete. Tested on code-blocks help only, but should work for embed type too.
It addresses one of the future plans in #2667, however the current help config structure doesn't seem to support per-guild settings easily, so this has been implemented as a global bot setting. Should be good enough though.
I have a few concerns about this implemented as-is, and this was the one thing on that list I was considering removing from it. It mostly comes down to not being able to come up with a good way to pick a lower bound on the timeout which is appropriate for anything from 1 page, to 100 help pages (and we already have at least 1 bot in testing with that many pages) to prevent help from being a useless command. I think the max pages in a guild setting and the menu option both do enough to prevent help spam in channels.
I mean, I understand this, but it's another thing that this is optional, and it just gives more options - it's disabled by default, and no one is forced to use this. If there's a bot with 100 help pages, and you think there cannot be a lower limit to the amount of time someone might need to read all of that, then they can just not be using this at all? When disabled, the messages stay and nothing changes. Additionally, there's a pretty high chance those 100 pages would end up in DMs due to the pages limit, where this feature is disabled too (no changes).
I feel this setting would be really useful for people who have small amount of pages of help, as well as optional cleaning up after showing help for individual cogs, commands and subcommands (those count as pages too, and they're usually just a single page).
Just because "it's optional" doesn't make it a good option for inclusion in core Red. There are more considerations we have with every addition, and I didn't get into all of the implementation pieces of that because I wasn't even still sure if we should support it as an option.
It's also:
As-is, this would be a hard no from me.
If you were to address confirming having permissions and also only use this setting if max pages is a guild is both set and under 100 (which limits the behavior of delete_messages to a single API call in addition without end-user inconsistent behavior) then it would be possible to consider as an option, but I didn't want to ask you to make these changes if we weren't even still sure it was something we should support.
I've coded this thing in 3 hours on today's morning (carried by the will of helping and "that'd be useful to have" idea), and was kinda expecting to receive harsh criticism based on this, yes.
I understand the concerns, and have addressed (and tested) them. The current implementation checks the amount of pages / messages to delete and appropriate permissions as requested. It also does one less config call, while reusing the computed permissions based on an assumption, for which I've left an informative (and hopefully sufficient) comment on.
The only worrying thing left here, would be the additional API call required for the messages to be deleted. I'm guessing this is left up for the discussion, but I think that since this is optional, one could just disable it if it'd cause any problems. That's just my way of thinking about it though.
I'm okay accepting this with one other tweak which seems to have been a misunderstanding of intention which was probably my fault.
The 100 messages condition isn't that there are less than 100 messages, it's that there can't ever be more than 100 with the current max pages in guild setting. This prevents an inconsistent behavior on the bot where it won't delete if the full help sends 200 pages, but a specific cog help only sent 2
@mikeshardmind
Seems like @DevilXD addressed most of your points we now actually do less config calls which is a nice chance (only 1 call) permissions being checked means 403s shouldn’t happen.
Given that quite a lot of users don’t use menus personally I think this opinions would be really welcomes by the community, given that I happens when there’s less than 100 pages too so it’s just 1 extra api call
@DevilXD can you add a check to the command itself to only be visible if the bot has manage message perms? Also mention that this will not work if there are more than 100 menu pages, which these to I’d give this feature a +1 from me.
Me and sinbad replied at the same time xD, functionally take his review, just the documentation part and check on mine please devil
thanks for the follow-up