[V3 Help] Menus in help #2255

Closed
bobloy wants to merge 13 commits from V3/help_menus into V3/develop
bobloy commented 2018-10-17 17:11:45 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

This modifies the help_formatter to use the utils.menus system to display help on servers.

It does not use it for pm, as you cannot manage reactions in pm.

It uses the built in configuration for maximum page size to split cog commands into multiple pages.
It uses the built in helpset pagecharlimit to set a guideline on how many cogs are displayed per page.

This obsoletes max_pages_in_guild and so it is removed.

### Type - [ ] Bugfix - [x] Enhancement - [ ] New feature ### Description of the changes This modifies the help_formatter to use the `utils.menus` system to display help on servers. It does not use it for pm, as you cannot manage reactions in pm. It uses the built in configuration for maximum page size to split cog commands into multiple pages. It uses the built in `helpset pagecharlimit` to set a guideline on how many cogs are displayed per page. This obsoletes `max_pages_in_guild` and so it is removed.
tekulvw (Migrated from github.com) reviewed 2018-10-17 17:11:45 +02:00
Twentysix26 (Migrated from github.com) reviewed 2018-10-17 17:11:45 +02:00
bobloy commented 2018-10-17 22:07:37 +02:00 (Migrated from github.com)

This may need some adjustment to skip menus when there is only one page.

Additionally, pm_help is not the same thing has using help in a pm and may need tweaking as well.

This may need some adjustment to skip menus when there is only one page. Additionally, `pm_help` is not the same thing has using `help` in a pm and may need tweaking as well.
bobloy commented 2018-10-19 20:14:31 +02:00 (Migrated from github.com)

This is ready for review.
https://github.com/Cog-Creators/Red-DiscordBot/pull/2255/commits/1a3750f2b0fea31bd1414f78b33c4ce917e34948 moved pm_check to be a function that could be used in the help command.
https://github.com/Cog-Creators/Red-DiscordBot/pull/2255/commits/40b7ea85a842e9a9e75657353e790381a6053d50 fixed using a menu with only one page. Additionally, it will check the use_embeds setting based on the destination context instead of the channel context. This resolves the bot sending code_blocks when embeds are requested but the bot lacks permission to post in the channel.

This is ready for review. https://github.com/Cog-Creators/Red-DiscordBot/pull/2255/commits/1a3750f2b0fea31bd1414f78b33c4ce917e34948 moved `pm_check` to be a function that could be used in the help command. https://github.com/Cog-Creators/Red-DiscordBot/pull/2255/commits/40b7ea85a842e9a9e75657353e790381a6053d50 fixed using a menu with only one page. Additionally, it will check the `use_embeds` setting based on the destination context instead of the channel context. This resolves the bot sending code_blocks when embeds are requested but the bot lacks permission to post in the channel.
aikaterna commented 2018-10-22 16:56:58 +02:00 (Migrated from github.com)

This is a really neat feature that a lot of people have requested over time. One thing I noticed while testing is that even with a small character page size set (like 300-400 characters per help page), I would get 2 smaller cogs and 1 large cog on the first page (Admin, Alias, Audio) which led to a really large page vs. what I expected to see because Audio has so many commands comparatively. I felt like maybe a good suggestion for pages would be to break it up per cog, but then you would have at least one case where a help page would be rather small, like one or two commands, because that's all the cog has - and ganging up more cogs on that page seems like the better option. Is there an easy way to implement per-cog paging without inconveniencing people that wouldn't like the super small help pages?

This is a really neat feature that a lot of people have requested over time. One thing I noticed while testing is that even with a small character page size set (like 300-400 characters per help page), I would get 2 smaller cogs and 1 large cog on the first page (Admin, Alias, Audio) which led to a really large page vs. what I expected to see because Audio has so many commands comparatively. I felt like maybe a good suggestion for pages would be to break it up per cog, but then you would have at least one case where a help page would be rather small, like one or two commands, because that's all the cog has - and ganging up more cogs on that page seems like the better option. Is there an easy way to implement per-cog paging without inconveniencing people that wouldn't like the super small help pages?
Ianardo-DiCaprio commented 2018-10-30 21:37:08 +01:00 (Migrated from github.com)

Issue, By removing the max_pages_in_guild, the bot will always try to post the help into the server and there is no current way to make it be forced to DM's like there is now with max_pages, so an option to force to DM's will need to be added.

Issue, By removing the max_pages_in_guild, the bot will always try to post the help into the server and there is no current way to make it be forced to DM's like there is now with max_pages, so an option to force to DM's will need to be added.
bobloy commented 2018-10-31 15:54:14 +01:00 (Migrated from github.com)

Issue, By removing the max_pages_in_guild, the bot will always try to post the help into the server and there is no current way to make it be forced to DM's like there is now with max_pages, so an option to force to DM's will need to be added.

After doing some digging, I found that pm_help is a parameter that is passed when creating the bot instance. This parameter currently handles forcing all help dialogue to PM's.
My guess is this is a relic of help coming from discord.py, and could safely be replaced with a config value instead.

> Issue, By removing the max_pages_in_guild, the bot will always try to post the help into the server and there is no current way to make it be forced to DM's like there is now with max_pages, so an option to force to DM's will need to be added. After doing some digging, I found that `pm_help` is a parameter that is passed when creating the bot instance. This parameter currently handles forcing all help dialogue to PM's. My guess is this is a relic of help coming from discord.py, and could safely be replaced with a config value instead.
bobloy commented 2018-10-31 18:06:36 +01:00 (Migrated from github.com)

One thing I noticed while testing is that even with a small character page size set (like 300-400 characters per help page), I would get 2 smaller cogs and 1 large cog on the first page (Admin, Alias, Audio) which led to a really large page vs. what I expected to see because Audio has so many commands comparatively.

#2281 Is my proposed fix to this problem.

Is there an easy way to implement per-cog paging without inconveniencing people that wouldn't like the super small help pages?

I've done some digging on this. The current setup groups by cog unless the subcommands are >1000 characters, then it splits it into multiple pages using built-in pagify. Afterwards, it groups the cogs until it is greater than the set page_char_limit in helpset. This leads to inconsistent page sizes.

As for a solution, I think #2281 will reign in the weirdness by adjusting the secondary grouping to aim for less than page_char_limit grouping. Per cog grouping could go a number of ways though.

Uniform pages could be better accomplished by dropping the alphabetical precedent of ordering help.
Per cog grouping with no regard for page size could be another option.

I'm currently toying around with it and will update here when I have something I like.

>One thing I noticed while testing is that even with a small character page size set (like 300-400 characters per help page), I would get 2 smaller cogs and 1 large cog on the first page (Admin, Alias, Audio) which led to a really large page vs. what I expected to see because Audio has so many commands comparatively. #2281 Is my proposed fix to this problem. > Is there an easy way to implement per-cog paging without inconveniencing people that wouldn't like the super small help pages? I've done some digging on this. The current setup groups by cog unless the subcommands are >1000 characters, then it splits it into multiple pages using built-in `pagify`. Afterwards, it groups the cogs until it is **greater** than the set `page_char_limit` in helpset. This leads to inconsistent page sizes. As for a solution, I think #2281 will reign in the weirdness by adjusting the secondary grouping to aim for **less than** `page_char_limit` grouping. Per cog grouping could go a number of ways though. Uniform pages could be better accomplished by dropping the alphabetical precedent of ordering help. Per cog grouping with no regard for page size could be another option. I'm currently toying around with it and will update here when I have something I like.
bobloy commented 2018-11-26 16:21:24 +01:00 (Migrated from github.com)

@aikaterna I've got a fix now for the grouping issues you brought up.

  • Pagifying has been moved to the group_fields function
  • Max 1000 characters is enforced
  • (Continued) lines are respected for their actual length
  • This replaces #2281 and can be closed if this is accepted.
@aikaterna I've got a fix now for the grouping issues you brought up. - Pagifying has been moved to the `group_fields` function - Max 1000 characters is enforced - `(Continued)` lines are respected for their actual length - This replaces #2281 and can be closed if this is accepted.
bobloy commented 2018-11-30 15:21:35 +01:00 (Migrated from github.com)

One more commit to address the comment by @Iangit1
Created a command to adjust the default bot.pm_help using [p]helpset dm

One more commit to address the comment by @Iangit1 Created a command to adjust the default `bot.pm_help` using `[p]helpset dm`
BurritoWrapped commented 2018-12-14 14:47:33 +01:00 (Migrated from github.com)

@bobloy Any progress on this? Can I help in any way?

@bobloy Any progress on this? Can I help in any way?
bobloy commented 2018-12-14 15:29:52 +01:00 (Migrated from github.com)

@bobloy Any progress on this? Can I help in any way?

This PR is ready for review. You can help by testing it and reporting whether you see any issues or not.

> @bobloy Any progress on this? Can I help in any way? This PR is ready for review. You can help by testing it and reporting whether you see any issues or not.
Kowlin commented 2018-12-14 15:46:56 +01:00 (Migrated from github.com)

As a reminder, all pull requests that are not fixes are ignored for the time being while we're in this RC period

As a reminder, all pull requests that are **not** fixes are ignored for the time being while we're in this RC period
bobloy commented 2019-01-02 19:56:07 +01:00 (Migrated from github.com)

Adjusted the timeout for reactions being removed to 60 seconds from the default of 30 seconds.

The purpose is to avoid timing out while reading long help pages. I could see it going up to 120 seconds even, but let me know what you think.

Adjusted the timeout for reactions being removed to 60 seconds from the default of 30 seconds. The purpose is to avoid timing out while reading long help pages. I could see it going up to 120 seconds even, but let me know what you think.
aikaterna commented 2019-01-05 03:54:14 +01:00 (Migrated from github.com)

A couple things: helpset pagecharlimit may need to be reduced to a range. Anything under approx 8 characters seems to crash the bot, or at least lock it up so that it doesn't respond. Seems to start looking appropriate at around 100 characters minimum, but even then only one command seems to be shown at once. Also, there is no upper limit and while I wasn't able to get the bot to error out or produce an overly large embed, that should be limited to slightly under the embed character limit for that field.
Also, while many people are excited about menu help and I appreciate the help in DM's option that was added recently, you might want to add an option to this to have the old default long-page style help in guild. There were a couple people I spoke to about this PR that seemed to be disappointed it was only a menu option in-guild without any of the old help (multiple messages).

A couple things: helpset pagecharlimit may need to be reduced to a range. Anything under approx 8 characters seems to crash the bot, or at least lock it up so that it doesn't respond. Seems to start looking appropriate at around 100 characters minimum, but even then only one command seems to be shown at once. Also, there is no upper limit and while I wasn't able to get the bot to error out or produce an overly large embed, that should be limited to slightly under the embed character limit for that field. Also, while many people are excited about menu help and I appreciate the help in DM's option that was added recently, you might want to add an option to this to have the old default long-page style help in guild. There were a couple people I spoke to about this PR that seemed to be disappointed it was only a menu option in-guild without any of the old help (multiple messages).
Ianardo-DiCaprio commented 2019-01-20 07:11:17 +01:00 (Migrated from github.com)

As a request for the helpset toggle. Could you make it so it's server specific. So I could have it send the help in some servers to send this new help menu, and some servers have it to send to DM's.

As a request for the helpset toggle. Could you make it so it's server specific. So I could have it send the help in some servers to send this new help menu, and some servers have it to send to DM's.
mikeshardmind commented 2019-02-04 09:11:26 +01:00 (Migrated from github.com)

I'd like this to be an option. I'd rather not remove the old formatter behavior (it's nice to just have a full help menu in places), but provide this as an alternative output for it.

I'd like this to be an option. I'd rather not remove the old formatter behavior (it's nice to just have a full help menu in places), but provide this as an alternative output for it.
mikeshardmind commented 2019-04-23 03:33:48 +02:00 (Migrated from github.com)

Closing due to large upstream changes in the help formatter.

I'd love to see this working, but it needs large retooling to be compatible with discord.py changes being added in #2587

Closing due to large upstream changes in the help formatter. I'd love to see this working, but it needs large retooling to be compatible with discord.py changes being added in #2587

Pull request closed

Sign in to join this conversation.
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 milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!2255
No description provided.