Comments (8)
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.
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.
Is this with CommandsNext
? We provide support for a Scoped
lifetime in our SlashCommands framework
from dsharpplus.
Is this with
CommandsNext
? We provide support for aScoped
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.
Can you specifiy what api/internal change you would want?
from dsharpplus.
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.
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.
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)
- slash command invocations before GuildDownloadCompleted cause a null reference
- Add option to use no prefix HOT 7
- Getting 'application did not respond' after adding Choice Providers HOT 3
- Ability to add our own additional components to a SendPaginatedResponseAsync
- Permissions in future library versions
- Command regristration is bugged when using assembly to register all commands HOT 2
- General onboarding documentation HOT 7
- versions after 4.4.6 break SlashRequirePermissions HOT 9
- Scoped/Transient dependency dependant on data from discord
- Commands not being registered HOT 23
- DiscordClientBuilder doesn't exist HOT 2
- Object ref not set to an instance of an object when creating a Direct Message after longer uptime HOT 3
- DiscordRestClient's HttpClient has no Authorization Header HOT 2
- Interactivity trying to de-register events, causing exception on disposing the DIscordClient. HOT 2
- Missing ShardClients HOT 6
- FollowupAsync throws a 404 not found
- Sharded client does not load all guilds. HOT 4
- Failed to decompress a gateway payload HOT 1
- Add Shard ID to event args. HOT 4
- Addition of docs about allowed command arguments HOT 1
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 dsharpplus.