Coder Social home page Coder Social logo

Comments (8)

akiraveliara avatar akiraveliara commented on July 4, 2024 1

we have plans for a similar feature, albeit slightly different for technical reasons. it'll probably be tested soon-ish and published to nightly thereafter.

that said, please also avoid cross-linking unrelated issues

from dsharpplus.

OoLunar avatar OoLunar commented on July 4, 2024

Hey, thanks for opening up an issue!

Could we get a little bit more information? This sounds like you're working with a command framework. Is this with CommandsNext or SlashCommands? Secondly, could we get a small code example of what you're currently doing and how the behavior is different from what you're expecting?

from dsharpplus.

Plerx2493 avatar Plerx2493 commented on July 4, 2024

Is this with CommandsNext? We provide support for a Scoped lifetime in our SlashCommands framework

from dsharpplus.

RosenDev avatar RosenDev commented on July 4, 2024

Is this with CommandsNext? We provide support for a Scoped lifetime in our SlashCommands framework

Yes its connected with command next but there is no issue with the lifetime. Its an improvement of the structure of the code.

from dsharpplus.

Plerx2493 avatar Plerx2493 commented on July 4, 2024

Can you specifiy what api/internal change you would want?

from dsharpplus.

RosenDev avatar RosenDev commented on July 4, 2024

Can you specifiy what api/internal change you would want?

Well sorry for the delay i was just figuring out how it will happen with the command context.

Here is example code leave your feedback if its possible to implement.

`
var registeredCommandSources = new Dictionary<string, Func<IServiceProvider, CommandContext, string[], Task>>();

        //adding a command example

        Func<IServiceProvider, CommandContext, string[], Task> hiCommandSource = (sp, ctx, args) => { return ctx.RespondAsync("Hi"); };


        registeredCommandSources.Add("commandName", hiCommandSource);


        //executing the command

        //just for the example in real situation real values should be passed
        var serviceProvider = new ServiceCollection().BuildServiceProvider();

        await registeredCommandSources["commandName"](serviceProvider, null, new string[3]);`

from dsharpplus.

RosenDev avatar RosenDev commented on July 4, 2024

Hey, thanks for opening up an issue!

Could we get a little bit more information? This sounds like you're working with a command framework. Is this with CommandsNext or SlashCommands? Secondly, could we get a small code example of what you're currently doing and how the behavior is different from what you're expecting?

Hi I provided an example of what I meant in my comment. Its my latest reply to Plerx2493

from dsharpplus.

RosenDev avatar RosenDev commented on July 4, 2024

we have plans for a similar feature, albeit slightly different for technical reasons. it'll probably be tested soon-ish and published to nightly thereafter.

that said, please also avoid cross-linking unrelated issues

Sorry didn't saw the last comment and accidently linked this one. Removed my comment for your issue you can unlink it.

Best regards,

Rosen

from dsharpplus.

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.