Currently works with Labs only! Supports slash commands and message components.
There are 3 parts (assemblies) of the library, typical usage in a project will be to use all 3.
There is Discord.Net.Interactions.Abstractions
with interfaces and some extension
methods. This should typically be used in a library that will be implementing different
behavior than the one present in Discord.Net.Interactions
Second one is Discord.Net.Interactions
with default implementations of the
abstractions and interactions service that can be used to manage and handle commands.
For better usage with dependency injection, Discord.Net.Interactions.DI
may
be used. It provides extension methods for IServiceCollection
Main goal of this library is extensibility and replaceability. Each part of the library can be implemented differently to match your project needs. This is achieved by making splitting the library to multiple parts and layers.
Example can be found in Discord.Net.Interactions.Example
.
The use basically lays in creating InteractionHolder
for storing the interactions,
CommandRegistrator
for registering the commands (one by one, bulk etc.),
InteractionExecutor
for executing the interactions on different thread or auto deferring
them. And lastly implementing ICommandGroup
to setup your commands.
InteractionsService
is used to connect these together along
with handling the interactions.
There are default implementations of all of the classes except ICommandGroup
which must be implemented for specific commands. By using dependency injection
extensions from Discord.Net.Interactions.DI
only a few calls of extension
methods are needed to get the library running then.