Red-DiscordBot icon indicating copy to clipboard operation
Red-DiscordBot copied to clipboard

Command groups fail to set `help` attribute when explicitly supplied

Open Zephyrkul opened this issue 1 year ago • 2 comments

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

Zephyrkul avatar Aug 28 '22 20:08 Zephyrkul

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

Minimal example

Zephyrkul avatar Aug 28 '22 20:08 Zephyrkul

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

Flame442 avatar Aug 28 '22 21:08 Flame442