-
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
refactor: Bot.load_extensions
rework
#796
base: master
Are you sure you want to change the base?
Conversation
not really necessary since Iterator is covariant, but might as well do it anyway
Recently I've realized there are few ways of passing stuff around that doesn't involve slapping said stuff as bot attribute. |
That would be useful, yeah.
(created a thread here: https://canary.discord.com/channels/808030843078836254/1092780323307257906) |
Summary
This PR refactors
Bot.load_extensions
, improving several aspects and hopefully making common patterns easier to use.Module discovery now works similar to
pkgutil.walk_packages
.Initially I removed
utils.search_directory
entirely, but then opted to keep it for now and only deprecate it. While the transition toBot.find_extensions
(or even justBot.load_extensions
) should be trivial, having a deprecation period still won't hurt.It might look like a lot, but most of it is documentation and tests :p
Docs can be found here https://disnake--796.org.readthedocs.build/en/796/ext/commands/extensions.html#ext-commands-extensions-load.
related: #1132
TODO
Checklist
task lint
task pyright