Giter Club home page Giter Club logo

Comments (4)

Gorialis avatar Gorialis commented on August 17, 2024 1

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.

Gorialis avatar Gorialis commented on August 17, 2024 1

This problem is mostly addressed by the jishaku Feature system in v2.

from jishaku.

Gorialis avatar Gorialis commented on August 17, 2024

The command parent must use @commands.group() (a Command cannot have child commands)

from jishaku.

StarrFox avatar StarrFox commented on August 17, 2024

Sorry forgot that when making the reproduction steps, still have the same issue when using commands.group though

from jishaku.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.