Max/Min length fields for ApplicationCommandOption (#2379)

* implement max/min length fields for ApplicationCommandOption

* fix badly formed xml comments
This commit is contained in:
Cenk Ergen
2022-08-03 16:44:30 +03:00
committed by GitHub
parent 1eb42c6128
commit e551431d72
12 changed files with 210 additions and 5 deletions

View File

@@ -38,6 +38,16 @@ namespace Discord.Interactions
/// </summary>
public double? MaxValue { get; }
/// <summary>
/// Gets the minimum length allowed for a string type parameter.
/// </summary>
public int? MinLength { get; }
/// <summary>
/// Gets the maximum length allowed for a string type parameter.
/// </summary>
public int? MaxLength { get; }
/// <summary>
/// Gets the <see cref="TypeConverter{T}"/> that will be used to convert the incoming <see cref="Discord.WebSocket.SocketSlashCommandDataOption"/> into
/// <see cref="CommandParameterInfo.ParameterType"/>.
@@ -86,6 +96,8 @@ namespace Discord.Interactions
Description = builder.Description;
MaxValue = builder.MaxValue;
MinValue = builder.MinValue;
MinLength = builder.MinLength;
MaxLength = builder.MaxLength;
IsComplexParameter = builder.IsComplexParameter;
IsAutocomplete = builder.Autocomplete;
Choices = builder.Choices.ToImmutableArray();