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

Revert #817 due to high-severity prefix command errors introduced by its changes #829

Merged
merged 2 commits into from
Jan 22, 2022

Conversation

krittick
Copy link
Contributor

Summary

This reverts #817 (and by extension, #826) due to the issues it introduced being higher in severity than the intended fix.

For example, using the prefix-based help command causes this error:

Traceback (most recent call last):
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\ext\commands\core.py", line 179, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\ext\commands\help.py", line 838, in command_callback
    mapping = self.get_bot_mapping()
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\ext\commands\help.py", line 382, in get_bot_mapping
    mapping[None] = [c for c in bot.commands if c.cog is None]
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\ext\commands\core.py", line 1185, in commands
    return set(self.all_commands.values())
TypeError: unhashable type: 'SlashCommand'

Using bot.reload_extension causes this error:

Traceback (most recent call last):
[jishaku-related traceback removed]

  File "<repl>", line 2, in _repl_coroutine
    bot.reload_extension("extensions.ext_libtests")
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\cog.py", line 816, in reload_extension
    self._remove_module_references(lib.__name__)
  File "C:\Users\ben\PycharmProjects\cbot\venv3.10\lib\site-packages\discord\cog.py", line 614, in _remove_module_references
    if cmd.module is not None and _is_submodule(name, cmd.module):
AttributeError: 'SlashCommand' object has no attribute 'module'

There are also reports of other related issues in our discord server, (such as error handlers being broken), but I haven't tested that one myself.

I believe all of these issues are caused by the merging of the app and prefix command dicts and we should revert until we can fully test a more thorough implementation of the intended fix from #817.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, typehinting, examples, ...)

@krittick krittick added bug Something isn't working priority: high High Priority Merge normally labels Jan 21, 2022
@krittick krittick self-assigned this Jan 21, 2022
@plun1331
Copy link
Member

I'll do more testing next time

@krittick krittick merged commit d2d8042 into Pycord-Development:master Jan 22, 2022
@krittick krittick mentioned this pull request Jan 23, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high High Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants