Interface IParameterInfo
Represents a ICommandInfo parameter.
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public interface IParameterInfo
Properties
| Improve this Doc View SourceAttributes
Gets a list of the attributes this parameter has.
Declaration
IReadOnlyCollection<Attribute> Attributes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<Attribute> |
Command
Gets the command that this parameter belongs to.
Declaration
ICommandInfo Command { get; }
Property Value
Type | Description |
---|---|
ICommandInfo |
DefaultValue
Gets the default value of this parameter if the parameter is optional.
Declaration
object DefaultValue { get; }
Property Value
Type | Description |
---|---|
Object |
IsParameterArray
Gets whether this parameter is marked with a langword_csharp_params keyword.
Declaration
bool IsParameterArray { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsRequired
Gets whether this parameter is required.
Declaration
bool IsRequired { get; }
Property Value
Type | Description |
---|---|
Boolean |
Name
Gets the name of this parameter.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
ParameterType
Gets the type of this parameter.
Declaration
Type ParameterType { get; }
Property Value
Type | Description |
---|---|
Type |
Preconditions
Gets a list of the preconditions this parameter has.
Declaration
IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<ParameterPreconditionAttribute> |
Methods
| Improve this Doc View SourceCheckPreconditionsAsync(IInteractionContext, Object, IServiceProvider)
Check if an execution context meets the parameter precondition requirements.
Declaration
Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, object value, IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context | |
Object | value | |
IServiceProvider | services |
Returns
Type | Description |
---|---|
Task<PreconditionResult> |