Command groups fail to set help attribute when explicitly supplied #5838

Closed
opened 2022-08-28 22:11:13 +02:00 by Zephyrkul · 3 comments
Zephyrkul commented 2022-08-28 22:11:13 +02:00 (Migrated from github.com)

What Red version are you using?

3.4.18 and 3.5.0 latest commit

What were you trying to do?

Pass help= explicitly to the @commands.group decorator

What did you expect to happen?

The command's helptext to be set to the supplied help= value

What actually happened?

group.help is left as an empty string

How can we reproduce this error?

Minimal code example

Anything else?

No response

### What Red version are you using? 3.4.18 and 3.5.0 latest commit ### What were you trying to do? Pass `help=` explicitly to the `@commands.group` decorator ### What did you expect to happen? The command's helptext to be set to the supplied `help=` value ### What actually happened? `group.help` is left as an empty string ### How can we reproduce this error? ![Minimal code example](https://user-images.githubusercontent.com/23347632/187092676-b8416fce-50fa-46ec-8377-8760e4aaab05.png) ### Anything else? _No response_
Zephyrkul commented 2022-08-28 22:57:35 +02:00 (Migrated from github.com)

I'll also note that commands themselves still accept help= as expected

Minimal example

I'll also note that commands themselves still accept `help=` as expected ![Minimal example](https://user-images.githubusercontent.com/23347632/187094216-f887af0d-f022-4a8f-b63a-43b26f8dec76.png)
Flame442 commented 2022-08-28 23:31:18 +02:00 (Migrated from github.com)

github.com/Cog-Creators/Red-DiscordBot@cadcffbae5/redbot/core/commands/commands.py (L987-L1002)

This appears to be handled in @command deco by the line attrs["help_override"] = attrs.pop("help", None). With some BRIEF testing, adding this line to the @group deco fixes this behavior. I cannot guarantee there are no side effects from adding this line to the group deco.
image

https://github.com/Cog-Creators/Red-DiscordBot/blob/cadcffbae5544cffd87a02e07d886f6aa4db65aa/redbot/core/commands/commands.py#L987-L1002 This appears to be handled in `@command` deco by the line `attrs["help_override"] = attrs.pop("help", None)`. With some BRIEF testing, adding this line to the `@group` deco fixes this behavior. I cannot guarantee there are no side effects from adding this line to the group deco. ![image](https://user-images.githubusercontent.com/34169552/187095282-7888db67-8506-464d-8466-8281f72b4f7a.png)
Owner

Fixed by #5839, which has been merged into V3/develop.

Fixed by #5839, which has been merged into V3/develop.
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
2 participants
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#5838
No description provided.