Git Product home page Git Product logo

Comments (2)

LordOfPolls avatar LordOfPolls commented on August 17, 2024

So - taking this issue literally, i disagree with the premise All methods to define application commands should have consistent signatures - same args, same type hinting, same defaults

if we look at the methods to instantiate a app command we have

  • @slash_command
  • @subcommand
  • class SlashCommand
  • SlashCommand.subcommand

Going one by one;

  • @slash_command being the recommended to make a non-sub app command. Its type hints are weird, they should be fixed.
  • @sub_command as per its docstring, is inteded to be an alternate way to define a slash command, specifically for sub commands. It was also requested. By its very purpose it should NOT have the same signature as @slash_command
  • SlashCommand.subcommand is the alternate to @sub_command- which creates a subcommand from an existing command, as it is creating a command based off of another, there are certain fields it should not have. Again meaning it shouldnt share a signature
  • class SlashCommand being the last suppported way to create a command, isnt really an recommended way to define commands, its designed to act as a model, not a construction vector. By its very purpose, it shouldnt mirror the type hints nor signature of the decors as its use case would be completely different.

I'll admit work could be done to ensure the resultant command object has the same defaults between them, but a blanket all signatures should be the same is asinine and defeats the purpose of having multiple methods. They are literally not supposed to be the same

If ive missunderstood, please correct me.

from naff.

LordOfPolls avatar LordOfPolls commented on August 17, 2024

Closing due to inactivity

from naff.

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.