-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
imports not working #81
Comments
Given that there aren't any diagnostics in this issue and v1 hasn't changed since the v2 push, I can't really assume anything other than your install has become broken somehow. The immediate thing I'd expect to fix it is just doing: pip uninstall jishaku
pip install -U --no-deps --force-reinstall jishaku If that fails, you will have to run through some diagnostic steps yourself:
Other potential culprits are maybe permissions issues, but regardless, this doesn't seem like anything caused by jishaku. |
I have done all the above. the For some reason it wont let me add a screenshot, but in the link below you can see that somehow the |
Do you have I think the likely explanation for why this happens probably stems from how discord.py resolves extension submodule dependencies. I'm guessing that because you do something along the lines of As an interesting aside, before the new reload logic was even added into discord.py, jishaku was mostly responsible for its own reload, and even had a dedicated command for it back in the day. A remnant of this logic is actually still present even in the current v2 code, labelled only vaguely as "panic recovery mode". If my speculation is right, I'm not really sure what the solution to it would be. If the library was itself adjusted to reload parent modules, you'd get odd situations where stuff would get reloaded when it really shouldn't be ( If you don't already have Another potential slapstick fix would be to force a reload of the main module at load time: import importlib
import jishaku
...
def setup(bot: commands.Bot):
importlib.reload(jishaku)
bot.add_cog(CustomJishaku(bot=bot)) I don't like either of these as permanent solutions, so I'll probably have to dig into how the submodule resolution works again and see if I can fool discord.py into reloading jishaku subclass extensions properly. |
So I have been trying out multiple things, and what eventually seemed to be the breaking change was
Personally I dont see how there is any difference, but I'm also not the biggest expert at this as I often just think like "if it works, dont touch it" :) |
I do have another question about subclassing commands in v2.0.0.. I know its not officially released yet but since I like to keep my things updated I wanted to look into this before the final release. Would you want me to open a separate issue for this? Or is there any place on discord where I can ask for this? |
I'm still scratching my head over this problem... I can't seem to replicate it no matter what I do. I reckon it's definitely something to do with extension management, and maybe whatever behavior caused this is fixed in discord.py, or maybe there's a behavior difference between Python versions. I'm thinking about writing some unit tests for things like this, as well as just some ones for testing subclass behavior in general, since honestly those need to be done before 2.0 has a realistic chance of releasing... maybe it'll reveal something, who knows. |
Since the Feature rewrite redoing how subclasses work, I don't think it would really be possible to reproduce this issue anymore on the latest version. If such a scenario arises, then a new issue can be made about it, but I haven't had anyone run into this problem since so I'm assuming it probably no longer applies. |
Summary
I was working on subclassing the jishaku command to make it work with my command system, but for some reason I am missing things in my jishaku but jishaku does still seem to work. I have tried this on both 1.20.0 and 2.0.0 and with both I have the same issue...
Reproduction steps
I'm not sure. I completely reinstalled jishaku, and I even tried loading just by
bot.load_extension("jishaku")
in stead of the file with my subclass.Expected results
Having access to anything in jishaku
Actual results
Dont have access to basically everything. ( https://media.discordapp.net/attachments/381963689470984203/787497858994798602/unknown.png )
Checklist
System information
Jishaku 1.20.0 (and tried 2.0.0 as well),
discord.py 1.5.1
The text was updated successfully, but these errors were encountered: