Class SlashCommandOptionBuildService
Holds all methods to build ISlashCommandOptionInfos for ISlashCommandInfos.
Inheritance
Implements
Inherited Members
Namespace: Color_Chan.Discord.Commands.Services.Implementations.Builders
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class SlashCommandOptionBuildService : ISlashCommandOptionBuildService
Constructors
| Improve this Doc View SourceSlashCommandOptionBuildService(ILogger<SlashCommandOptionBuildService>)
Initializes a new instance of SlashCommandOptionBuildService.
Declaration
public SlashCommandOptionBuildService(ILogger<SlashCommandOptionBuildService> logger)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.ILogger<SlashCommandOptionBuildService> | logger | The Microsoft.Extensions.Logging.ILogger for SlashCommandOptionBuildService. |
Methods
| Improve this Doc View SourceBuildSlashCommandsOptions(IEnumerable<ISlashCommandOptionInfo>)
Builds a System.Collections.Generic.IEnumerable<T> of DiscordApplicationCommandOptionDatas from ISlashCommandInfos.
Declaration
public IEnumerable<DiscordApplicationCommandOptionData> BuildSlashCommandsOptions(IEnumerable<ISlashCommandOptionInfo> commandOptionInfos)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ISlashCommandOptionInfo> | commandOptionInfos | The ISlashCommandInfo that will be converted to DiscordApplicationCommandOptionData. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordApplicationCommandOptionData> | The generated System.Collections.Generic.IEnumerable<T> of DiscordApplicationCommandOptionDatas |
Exceptions
Type | Condition |
---|---|
UpdateSlashCommandException | Thrown when the command exceeds the maximum allowed options. |
GetCommandOptions(MethodInfo)
Get all all the data from the parameters with the SlashCommandOptionAttribute.
Declaration
public IEnumerable<ISlashCommandOptionInfo> GetCommandOptions(MethodInfo command)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | command | The System.Reflection.MethodInfo that will be used to find the parameters. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISlashCommandOptionInfo> | A System.Collections.Generic.IEnumerable<T> of ISlashCommandOptionInfo containing all the data for the options. |