Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgroup having MISSING cog attribute #2302

Closed
3 tasks done
Dasupergrasskakjd opened this issue Dec 25, 2023 · 0 comments · Fixed by #2303
Closed
3 tasks done

Subgroup having MISSING cog attribute #2302

Dasupergrasskakjd opened this issue Dec 25, 2023 · 0 comments · Fixed by #2303
Labels
unconfirmed bug A bug report that needs triaging

Comments

@Dasupergrasskakjd
Copy link
Contributor

Dasupergrasskakjd commented Dec 25, 2023

Summary

The bot raises Attribute error when you invoke a subcommand under a subgroup under a command group

Reproduction Steps

  1. Create a command group
  2. Create a subgroup under it
  3. Create a command under it
  4. Invoke the command

Minimal Reproducible Code

group = bot.create_group("test1")
subgroup = group.create_subgroup("test2")

@subgroup.command()
async def test3(ctx):
   ...

Expected Results

Run the command

Actual Results

Raises an error

Traceback (most recent call last):
  File "d:\Personal\Documents\GitHub\Grass-bot-rewrite\.venv\Lib\site-packages\discord\commands\core.py", line 131, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "d:\Personal\Documents\GitHub\Grass-bot-rewrite\.venv\Lib\site-packages\discord\commands\core.py", line 1365, in _invoke
    await command.invoke(ctx)
  File "d:\Personal\Documents\GitHub\Grass-bot-rewrite\.venv\Lib\site-packages\discord\commands\core.py", line 378, in invoke
    await self.prepare(ctx)
  File "d:\Personal\Documents\GitHub\Grass-bot-rewrite\.venv\Lib\site-packages\discord\commands\core.py", line 299, in prepare
    if not await self.can_run(ctx):
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Personal\Documents\GitHub\Grass-bot-rewrite\.venv\Lib\site-packages\discord\commands\core.py", line 396, in can_run
    local_check = cog._get_overridden_method(cog.cog_check)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: '_MissingSentinel' object has no attribute '_get_overridden_method'

Intents

All

System Information

  • Python v3.11.5-final
  • py-cord v2.4.1-final
  • aiohttp v3.8.6
  • system info: Windows 10 10.0.22621

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

#1594 should have fixed it but it only fixed for commands under a group but not commands under a subgroup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant