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

Fix checks not properly handling Group commands type

Open Sutaai opened this issue 7 months ago • 2 comments

Description of the changes

This PR propose to add the type Group to the type variable used in Requires.get_decorator (Which is used by Red's checks).

This was made as creating a command group, in addition of one of Red's provided check, would alert Pylance of incorrect type, expecting type Command only.

Before

image

After image image

The correct type is now reflected. Same issue and fix apply for @commands.hybrid_group

Have the changes in this PR been tested?

Yes

Sutaai avatar May 25 '25 00:05 Sutaai

I would be interested to know if swapping the order of your checks on the group would make the error go away - put the is_owner below the @commands.group().

Flame442 avatar May 25 '25 00:05 Flame442

It does, but raise another error that I believe is rather more of an issue from discord.py. image

This issue (This screenshot) apply to anything as long as @commands.group()/.command() is not the last decorator as far as I've seen. Some other combination could work.

Sutaai avatar May 25 '25 01:05 Sutaai