Handle responding to interactions in help formatter for hybrids #6724
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!6724
Loading…
Reference in a new issue
No description provided.
Delete branch "sendhelp-hybrid"
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
Fixes #5916
This PR fixes an issue when using
ctx.send_help()in a hybrid command's slash command, it causes a timeout if the help menu is set to not use menus. We are simply sending withctx.send()instead ofdestination.send()on first page when it's an interaction and bot does not send help through dms.Have the changes in this PR been tested?
Yes
This will just have the bot be in an infinite
thinkingstate since defer expects another interaction response, which is never provided in the case of a DM. It's better to just directly respond with an ephemeral message saying that the bot sent a DM.Both fixes implemented, let me know if there's more !
@ -907,8 +908,12 @@ class RedHelpFormatter(HelpFormatterABC):)else:messages.append(msg)This seems simpler / avoids a conditional in every iteration and having to use
enumerate():By the way, I want to note that when there are fewer than 6 pages, we could theoretically use
ctx.send()because aside from the interaction response, it can send up to 5 follow-up responses. I'm not actually suggesting doing that here because it would need further discussion, but I just thought it was interesting.Considering that the command can use
await ctx.send_help()after doing something else first, this should be a more universal solution.Specficially, this will work better in case the interaction is expired (in which case, this will ensure the message is sent to the channel rather than as a response) or if the user has already responded to the interaction (in which case, this will ensure the message is sent through an interaction follow-up):
Updated files to match your suggestions !
@ -907,8 +908,12 @@ class RedHelpFormatter(HelpFormatterABC):)@ -907,8 +908,12 @@ class RedHelpFormatter(HelpFormatterABC):)These
ifs have a common condition: