-
-
Notifications
You must be signed in to change notification settings - Fork 482
refactor: ♻️ Refactor weird checks in CogMeta and fix some typing and other qol things
#2730
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
Merged
Lulalaby
merged 16 commits into
Pycord-Development:master
from
Paillat-dev:refactor/things
Oct 21, 2025
Merged
refactor: ♻️ Refactor weird checks in CogMeta and fix some typing and other qol things
#2730
Lulalaby
merged 16 commits into
Pycord-Development:master
from
Paillat-dev:refactor/things
Oct 21, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34e8104 to
e127333
Compare
CogMeta and fix some typingCogMeta and fix some typing and other qol things
CogMeta and fix some typing and other qol thingsCogMeta and fix some typing and other qol things
f597e62 to
2787966
Compare
…typing` Deprecated since python 3.9, py-cord supports 3.9+
Signed-off-by: Paillat <me@paillat.dev>
b55c125 to
82659b2
Compare
Lulalaby
approved these changes
Oct 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes made:
SlashCommand.parentBridgeCommand.__bridge__which isTrueBridgeCommandby checking it has anadd_toattribute (BridgeCommandis the only class in py-cord that has such method) with aTypeGuardthat checks it has a__bridge__attribute (which also makes this typed and that's cool)CogMeta.__cog_commands__name_filterto_name_filterand define it outside of__new__to avoid redefining it every time and also avoid assigning a lambda to a variable.bot_orcog_prefixes) to a helper function_validate_name_prefix._process_attributes. Simplify it by changing overengineered checks and simplifying dead code. Renameelem, valuetoattr_name, attr_value_update_command, idem as above.Generator&Mappingfromcollections.abcinstead oftyping(deprecated since python 3.9).Tested and fixed all the issues I found, but it would be nice if someone else could also test this to make sure I didn't miss anything.
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.