-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: create basic functionality for Extensions #428
Conversation
Expands Extension.__new__ and adds new functions to mimic client decorators
for more information, see https://pre-commit.ci
I would like someone to double check that everything works, and I'm not just hallucinating a lack of errors. It would probably be a good idea to simplify some of the code, I got it working but it doesn't look the nicest |
Delta and I will test this code when this PR is marked ready for reviewing |
There's support for |
No support for modals either |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please pre-commit though.
Co-authored-by: Max Hirtz <maxyolo01.ytb@gmail.com>
This is LGTM, I think we're finally ready to go ahead and merge this. I'll be leaving the last approval on this for @DeltaXWizard , but all of these changes look good on my end. |
You may need to run pre-commit again after new pending changes, I'll test afterwards though :) |
After some more tests, I figured out that there still are a few problems to address:
Feel free to ask me if you need some example code to recreate these issues. |
I don't think you are supposed to load extensions after |
I want to test again, just to make sure I fixed the breaking changes from the last patch |
Didn't know it might be a possibility that it shouldn't be loaded afterwards, in fact I was creating a Slash Command that allows the user to un/re/load cogs directly via Discord. I've previously done it with d.py, so I thought that it would be a feature that i.py should also have. |
Afaik fl0w wanted something like hot reload for cogs at first so it should be possible tho shouldn't it? |
Oh ok never mind then |
Co-authored-by: Max <maxyolo01.ytb@gmail.com>
I don't know how to do pre-commit |
Alright there is still the problem that "global" commands (not initialized in cogs) disappear after loading any cog on my side. The other issues have been fixed though. |
I'm unable to reproduce this. All commands outside of the cog remain usable, and any inside get added/removed as the cog gets loaded/unloaded. The only reason I can think of for it happening would be global commands, as I've only been testing in the guild scope. I'll try global commands now, but I don't expect a difference |
Oh my bad on this one, I formulated badly my previous message. In fact, I also have tried it only with a guild scope. |
I've recreated the missing commands issue, and it seems to only happen when a cog is unloaded then reloaded in quick succession. Any ideas as to why or where this is happening is welcome |
I'll be moving through with merging this to |
Expands Extension.new and adds new functions to mimic client decorators
About
This pr adds in basic functionality for the Extension class, along with decorators for commands/components/listeners
Marked as a draft because some things are missing, like properly removing commands on removal of the Extension
Any suggestions on improvements are welcome
Checklist
pre-commit
to format and lint the change(s) made.3.8.6
and higher.