Interface ISlashCommandOptionBuildService
Holds all methods to build ISlashCommandOptionInfos for ISlashCommandInfos.
Namespace: Color_Chan.Discord.Commands.Services.Builders
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public interface ISlashCommandOptionBuildService
Methods
| Improve this Doc View SourceBuildSlashCommandsOptions(IEnumerable<ISlashCommandOptionInfo>)
Builds a System.Collections.Generic.IEnumerable<T> of DiscordApplicationCommandOptionDatas from ISlashCommandInfos.
Declaration
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
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. |