Browse Source

Fix maximum number of Select Menu Options (#282)

As of https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure the maximum number of options is 25, not less than 25. Hopefully the change catches all necessary locations
pull/1923/head
Floowey GitHub 3 years ago
parent
commit
de404b2df9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs

+ 3
- 3
src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs View File

@@ -650,7 +650,7 @@ namespace Discord
get => _minValues; get => _minValues;
set set
{ {
Preconditions.LessThan(value, MaxValuesCount, nameof(MinValues));
Preconditions.AtMost(value, MaxValuesCount, nameof(MinValues));
_minValues = value; _minValues = value;
} }
} }
@@ -664,7 +664,7 @@ namespace Discord
get => _maxValues; get => _maxValues;
set set
{ {
Preconditions.LessThan(value, MaxValuesCount, nameof(MaxValues));
Preconditions.AtMost(value, MaxValuesCount, nameof(MaxValues));
_maxValues = value; _maxValues = value;
} }
} }
@@ -680,7 +680,7 @@ namespace Discord
set set
{ {
if (value != null) if (value != null)
Preconditions.LessThan(value.Count, MaxOptionCount, nameof(Options));
Preconditions.AtMost(value.Count, MaxOptionCount, nameof(Options));
else else
throw new ArgumentNullException(nameof(value), $"{nameof(Options)} cannot be null."); throw new ArgumentNullException(nameof(value), $"{nameof(Options)} cannot be null.");




Loading…
Cancel
Save