Comments (4)
Fixing this is kind of a pain. The key problem here is that GroupCogMeta
is parenting the Commands it sees on the class, but since the implementation is not overridden, the Commands it finds are from the superclass (JishakuBase
) and thus they get associated with the a Group owned by the subclass.
The two ways I can think of going about this while maintaining functionality are:
-
Creating some kind of 'factory' for JishakuBase-like classes that each consumer should call to receive their own personal baseclass (and thus the Commands of the baseclass being parented is not much of a problem, since it is in effect owned by its subclass). This feels like a pretty bad way of doing it, because dynamically manufacturing new types at runtime makes those types hard to work with (
isinstance(x, JishakuBase)
would no longer be possible) and it feels like it fundamentally breaks the principle of using baseclasses in the first place -
Creating a more complicated generalized metaclass similar to
GroupCogMeta
, but instead of assigning the existing commands of the class to a provided parent, instead takes in the parent and defines the Jishaku standard commands. The problem with this approach is that subclass command callbacks wouldn't be able to call back to their superclass versions, since they wouldn't be part of the superclass anymore.
Overall, I think that the class redesign, while allowing for more extensibility, has caused a lot more problems than it's probably been worth. I figure I will redesign it when I have a better idea of how to do it properly.
from jishaku.
This problem is mostly addressed by the jishaku Feature
system in v2.
from jishaku.
The command parent must use @commands.group()
(a Command cannot have child commands)
from jishaku.
Sorry forgot that when making the reproduction steps, still have the same issue when using commands.group though
from jishaku.
Related Issues (20)
- ability to add user who can run jishaku on the fly HOT 2
- Button disable
- Add Whois command HOT 2
- Unsupport discord.py v1.7.x HOT 1
- Python 3.9.13 not supported HOT 1
- Proper user configurable jsk py dict vars HOT 1
- change jishaku commands names HOT 1
- Jishaku version occasionally appears as vNone in selftest HOT 4
- Adding asqlite to options for the sql features HOT 3
- Unhandled code branch in `jishaku voice` command.
- Cog already loaded when loading it HOT 1
- I canβt use jishaku shell command HOT 2
- `jishaku timeit` raises an AttributeError upon use. HOT 1
- Tracking: need for a new release
- KeyError on Python version 3.11.0 HOT 3
- AttributeError: 'Context' object has no attribute 'add_reaction' HOT 2
- Question about next possible release to pypi HOT 2
- Convert message links to Message objects in REPLs HOT 1
- [Tracking] import_expression doesn't function correctly in 3.12 HOT 3
- jsk sync command broken on dpy master HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jishaku.