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)
- [Commands] Optional enum options in the middle, if left blank cause overflow exception HOT 2
- Polls support
- v5 extensions and events design HOT 18
- [Commands] Command class is assumed to be Group Command in CommandBuilder factory
- [Commands] Having multiple optional command parameters that some are left blank causes them to move forward
- VoiceNextConnection does not disconnect if called inside an event of a connection HOT 1
- DefaultCommandErrorHandlerAsync throws when Exception.Message.Length > 2000 chars
- Nullable slash command arguments throw DSharpPlus.Commands.Exceptions.ArgumentParseException HOT 2
- Nullable Enum cannot be used as SlashCommand argument HOT 1
- `InteractionConverterContext.Interaction.Data.Resolved.Roles` can be null when mentioning a `DiscordMember` or `DiscordUser`, causing NRE.
- Command parameters are getting wrong interpreted
- Rest client ratelimit inconsistencies
- VoiceNext VoiceReceive
- Getting archived threads for forum? HOT 4
- NRE on RequirePermissionCheck HOT 2
- Rework reconnection logic HOT 1
- [Commands] Unable to register UserContextMenu commands HOT 3
- Keyed service support
- Validate slashy names and descriptions before sending them off to discord HOT 1
- Consider using the newtonsoft.json reader aproach
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.