diff --git a/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs b/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs index d33990da1..8d6e22ec1 100644 --- a/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs +++ b/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs @@ -45,7 +45,9 @@ namespace Discord set { if (value?.Length > 100) - throw new ArgumentException("Name length must be less than or equal to 32"); + throw new ArgumentException("Description length must be less than or equal to 100"); + if (value?.Length < 1) + throw new ArgumentException("Description length must at least 1 character in length"); _description = value; } } diff --git a/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOptionChoice.cs b/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOptionChoice.cs index 53332c74b..4a1339dc2 100644 --- a/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOptionChoice.cs +++ b/src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOptionChoice.cs @@ -23,14 +23,17 @@ namespace Discord { if(value?.Length > 100) throw new ArgumentException("Name length must be less than or equal to 100"); + if (value?.Length < 1) + throw new ArgumentException("Name length must at least 1 character in length"); _name = value; } } - // Note: discord allows strings & ints as values. how should that be handled? - // should we make this an object and then just type check it? /// /// The value of this choice. + /// + /// Discord only accepts int and string as the input. + /// /// public object Value { diff --git a/src/Discord.Net.Core/Entities/Interactions/SlashCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/SlashCommandBuilder.cs index 97d9f7760..0f3ae1d2d 100644 --- a/src/Discord.Net.Core/Entities/Interactions/SlashCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/SlashCommandBuilder.cs @@ -296,7 +296,7 @@ namespace Discord set { if (value?.Length > SlashCommandBuilder.MaxNameLength) - throw new ArgumentException("Name length must be less than or equal to 32"); + throw new ArgumentException($"Name length must be less than or equal to {SlashCommandBuilder.MaxNameLength}"); if (value?.Length < 1) throw new ArgumentException("Name length must at least 1 characters in length"); @@ -317,9 +317,9 @@ namespace Discord set { if (value?.Length > SlashCommandBuilder.MaxDescriptionLength) - throw new ArgumentException("Description length must be less than or equal to 100"); + throw new ArgumentException($"Description length must be less than or equal to {SlashCommandBuilder.MaxDescriptionLength}"); if (value?.Length < 1) - throw new ArgumentException("Name length must at least 1 character in length"); + throw new ArgumentException("Description length must at least 1 character in length"); _description = value; }