[Help] Send menus to dm if maxpages is 0 #5375
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!5375
Loading…
Reference in a new issue
No description provided.
Delete branch "usemenus-dm"
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
Blocked by #6282Closes #5093
This PR will change help to send help menus to DMs if maxpages is 0.
Inconsistent with the "non-menu" mode the menus would always send in the invocation context even if maxpages was 0.
Currently i am a little stuck on the menus in the DM. For a reason i have yet to figure out the menu_ctx context does not play nicely with the menu.
While all messages and reactions can be sent/added, I can not flip the pages in the menu.
I can‘t seem to find the issue here. The menu works fine with the old implementation when invoked in dms but for some reason my context for m doesn‘t want to work with it.
This PR has conflicts due to the addition of button support to help's menu options. Looking at the
SimpleMenuclass, it requires actxobject to send the menu in, which won't exist for DMs. It does not support themessage=kwarg that the oldermenusupported, to put a menu onto an existing message. Continuing to include this change would require a different approach to support button menus.@TrustyJAID, you wrote the PR to add buttons to help, do you have any insight as to the best way to approach this?
I think the best path forward would be adding a new option on SimpleMenu called
start_dmwhich accepts a user parameter instead. This way it's a new feature for the menu and would allow this to happen. Looking at the SimpleMenu ctx is only used to extract the author and provide a messageable which can be simply replaced with the author in the new method.Blocked until #6282 is resolved and this PR can use the new method.
The issue appears to be that generating
ctxfrom a message sent by the bot setsctx.authorequal to the bot, rather than the invoker ofhelp. This means the menu is listening for reactions from the bot, rather than from the user.github.com/Cog-Creators/Red-DiscordBot@409ece427f/redbot/core/utils/menus.py (L200)It should be possible to monkeypatch the author attribute to fix this issue.