Skip to content

Fully support dependency injection in the Commands library #2183

@akiraveliara

Description

@akiraveliara

DSharpPlus.Commands supports constructing objects using the service provider created during startup, but it does not support constructing these objects in dependency injection. Instead, objects are constructed as if they were transient services, irrespective of their practical lifetime requirements; and they are not themselves accessible through dependency injection regardless of user requirements. This further drastically limits the extent of DI features we can use safely and correctly (see sub-issues for examples and details).

The extension should utilize available IoC abstractions such that:

  • the extension itself injects all of its constituent parts
  • all user-defined objects such as commands and checks are registered into and managed by the IoC container.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    commandsFor issues related to DSharpPlus.Commands

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions