Add buttons to help #5634
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!5634
Loading…
Reference in a new issue
No description provided.
Delete branch "add-help-buttons"
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?
Description of the changes
This adds support for button menus in help and adds a SimpleMenu cog creators can import to simply paginate items with buttons similar to the existing menu in terms of available features.
Have the changes in this PR been tested?
Yes
@ -12,0 +70,4 @@await interaction.message.delete()class SimpleMenu(discord.ui.View):I think Views should be suffixed with View (
SimpleMenuView?PaginatedView?) so it isn't confused with menus from the old ext library.@ -12,0 +70,4 @@await interaction.message.delete()class SimpleMenu(discord.ui.View):I don't see any confusion here? SimpleMenu could be put into the utils.menus namespace but since it's a view I think it makes more sense inside the new utils.views namespace.
[p]helpset usebuttonsand[p]helpset usemenusare currently separate settings but it might make sense for the setting to work as a tribool. Either way, the user should be informed (in help, maybe also in command responses) that setting both doesn't work/is required for buttons to function (depending on what you choose to do here)Should we use buttons if menus are toggled and the bot does not have reaction perms despite buttons not being set then?
I thought it was clear in the response "if menus are also enabled."
I'd support a tri-bool (a single command for toggling the three), one could get fancier by using a select menu for selecting the option perhaps.
My concern with a tri-bool is that there will be 2 groups of people, some who want buttons and some who do not want buttons. With a tri-bool I now have to decide whether True uses buttons or False uses buttons which will then cause some people in either group to be forced to change their setting appropriately. The current way I have it setup the bot will startup the way they're expecting and can then optionally adjust their settings as they wish.
I'm with Trusty on this and having it as two separate settings. Though I do like buttons, for menus, I'd prefer a selection menu, but that's not what's being talked about. In this case, I think leaving it up to the bot owner to set whether or not the bot were to use buttons should remain as-is and would be easier from a UX point to help differentiate what they do, rather than having it all in a single setting.
What I meant by tribool would be sth like
[p]helpset menus buttons/reactions/disable([p]helpset menusbeing the command)Something I have been thinking about is the possibility of attaching a select menu to the SimpleMenu. The idea being that if toggled the view would include the drop down selector showing up to 25 pages on the menu, if there's more than 25 the select menu would paginate e.g. if there's 50 pages and you're on page 25 it would show pages 13-37 on the drop down selector. Is this something people want included in this? Is this something people would want on
[p]helpas well? If it's included on[p]helphow should it work? should it be included with all buttons menus or should there be a way to use just buttons with no drop down selector?I have implemented my idea mentioned above and included options for buttons, buttons with select menu, and select menu only.
@ -12,0 +235,4 @@self.author = ctx.authorself.ctx = ctxkwargs = await self.get_page(self.current_page)self.message = await ctx.send(**kwargs, ephemeral=ephemeral)I'm not sure if you plan on making this PR depend on a higher version of discord.py, but for the version of discord.py that Red currently installs this raises a
TypeErrorfor the unexpectedephemeral=kwarg.@ -12,0 +235,4 @@self.author = ctx.authorself.ctx = ctxkwargs = await self.get_page(self.current_page)self.message = await ctx.send(**kwargs, ephemeral=ephemeral)I expect that by the time this PR gets fully reviewed and merged we will have bumped our d.py version to one that includes this kwarg on ctx. I added this as a sort of future-proof in the event cog creators want to use the menu as an ephemeral response from a slash command.
@ -12,0 +70,4 @@await interaction.message.delete()class SimpleMenu(discord.ui.View):I think SimpleMenu being placed here in views is totally fine and appropriate for its function and goal.
Working like a charm, thank you.