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

@@ -33,6 +33,12 @@ namespace Discord.WebSocket
/// <inheritdoc/>
public double? MaxValue { get; private set; }
/// <inheritdoc/>
public int? MinLength { get; private set; }
/// <inheritdoc/>
public int? MaxLength { get; private set; }
/// <summary>
/// Gets a collection of choices for the user to pick from.
/// </summary>
@@ -72,6 +78,9 @@ namespace Discord.WebSocket
IsAutocomplete = model.Autocomplete.ToNullable();
MinLength = model.MinLength.ToNullable();
MaxLength = model.MaxLength.ToNullable();
Choices = model.Choices.IsSpecified
? model.Choices.Value.Select(SocketApplicationCommandChoice.Create).ToImmutableArray()
: ImmutableArray.Create<SocketApplicationCommandChoice>();