Skip to content

Commit 161a91e

Browse files
authored
Fix AutocompleteResult.Value having no length limit (#3206)
1 parent 11a56bc commit 161a91e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Discord.Net.Core/Entities/Interactions/Autocomplete/AutocompleteResult.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public object Value
4646
if (value is not string && !value.IsNumericType())
4747
throw new ArgumentException($"{nameof(value)} must be a numeric type or a string! Value: \"{value}\"");
4848

49+
if (value is string stringValue)
50+
Preconditions.AtMost(stringValue.Length, 100, nameof(Value));
51+
4952
_value = value;
5053
}
5154
}

0 commit comments

Comments
 (0)