-
Notifications
You must be signed in to change notification settings - Fork 139
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
A defect in InteractionBotBase typings causes valid code to not type check properly. #1045
Comments
Adding the |
Thanks for the bug report, appreciate all the details c: |
InteractionBotBase is indeed a defect 🙃 |
It abstracts the entire app command framework into a mixin that can be used together with |
It could be a composite object. Instead of a bunch of subclasses for sharding and commands, a single Bot class could hold a (Sharded)Client, and a container for command managers. |
This sounds like a separate issue about refactoring how all these Clients, Bots and *Bases are structured. |
Of course, it's not related to this issue. I'll create an issue for it once I have a half decent idea for it. |
Such refactor won't happen before disnake 3.0, so there's no need for a gh issue. Instead we can include it in a list on the /projects tab |
Summary
A defect in InteractionBotBase typings causes valid application commands checks-related methods usage to make pyright sad.
Reproduction Steps
I'm using pdm here but this bug is not it's issue; choose whatever PM you prefer.
Reproduction steps:
Minimal Reproducible Code
Expected Results
I expected code to type check properly as the usage is perfectly correct.
Actual Results
Due to wrong typing inside disnake itself code cannot be type checked properly, though at runtime it works flawlessly.
Intents
Intents.default()
but that doesn't matter in this case.System Information
Checklist
Additional Context
I am aware of #614, but there no any mentions about possible downsides of broken typings. The phrasing there is also a bit confusing: "are not entirely correct" does not quite represent application commands methods using types intended for prefix ones (
Check
, specifically). Decorator versions work fine because of# type: ignore
s placed there (as mentioned accordingly in #614), despite for another reason, and are currently the only type-"safe" workaround (a partial workaround, as you still would not be able to remove checks as there isn't a decorator for that).The text was updated successfully, but these errors were encountered: