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

Fix: Fix discord.errors not working #681

Merged
merged 1 commit into from
Jan 24, 2022
Merged

Fix: Fix discord.errors not working #681

merged 1 commit into from
Jan 24, 2022

Conversation

sevenc-nanashi
Copy link
Contributor

Summary

It fixes discord.errors.XXX not working.
Currently, discord.errors is overridden by discord.commands.errors because of from .commands import *.
So I changed to from .commands.__init__ import *.

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, ...)

@Lulalaby Lulalaby enabled auto-merge (squash) January 2, 2022 14:12
@Lulalaby Lulalaby added bug Something isn't working Merge normally priority: high High Priority status: awaiting review Awaiting review from a maintainer labels Jan 2, 2022
@Lulalaby Lulalaby added this to the v2.0 milestone Jan 2, 2022
@Lulalaby Lulalaby disabled auto-merge January 2, 2022 14:13
@sevenc-nanashi
Copy link
Contributor Author

Any update on this?

@Middledot
Copy link
Member

Middledot commented Jan 8, 2022

Could you please provide recreation code where you got this error?

@sevenc-nanashi
Copy link
Contributor Author

@Middledot
it was working in original discord.py, but pycord not.
88B7F74B-1E98-4AB7-82DB-15A307C029DC

@mysistersbrother
Copy link

image
I can't replicate this error but discord.Forbidden should still work fine regardless of this problem. This isn't even really a problem considering you aren't supposed to access things through filename paths like this. As long as you follow the docs it is fine.
https://discordpy.readthedocs.io/en/latest/api.html#discord.Forbidden
image

Also commands shouldn't be imported in that file at all.
I don't know how you got that error in discord.py because it does not import commands there. Someone added that feature in this pycord fork when it shouldn't even be there. That would mean you can just do things like discord.Bot instead of importing commands. In fact importing commands would become completely redundant.

The real fix to this problem is just to remove that line which imports commands into the discord folder __init__ file.

Copy link
Member

@Middledot Middledot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that .commands.errors does override it

@Lulalaby Lulalaby merged commit 99b52e2 into Pycord-Development:master Jan 24, 2022
@sevenc-nanashi sevenc-nanashi deleted the fix/fix-commands-override branch January 24, 2022 20:02
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 status: awaiting review Awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants