From 161a91e73ed37fd18fe01780325f6008d27e5e56 Mon Sep 17 00:00:00 2001 From: HEJOK254 Date: Tue, 23 Dec 2025 19:12:39 +0000 Subject: [PATCH] Fix AutocompleteResult.Value having no length limit (#3206) --- .../Entities/Interactions/Autocomplete/AutocompleteResult.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Discord.Net.Core/Entities/Interactions/Autocomplete/AutocompleteResult.cs b/src/Discord.Net.Core/Entities/Interactions/Autocomplete/AutocompleteResult.cs index 6eb0493e..2fd8ecd9 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Autocomplete/AutocompleteResult.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Autocomplete/AutocompleteResult.cs @@ -46,6 +46,9 @@ namespace Discord if (value is not string && !value.IsNumericType()) throw new ArgumentException($"{nameof(value)} must be a numeric type or a string! Value: \"{value}\""); + if (value is string stringValue) + Preconditions.AtMost(stringValue.Length, 100, nameof(Value)); + _value = value; } }