From 758175793a7b40588e62f1b105f47bcd6a5f835f Mon Sep 17 00:00:00 2001 From: Dennis Fischer Date: Mon, 22 Nov 2021 09:42:12 +0100 Subject: [PATCH] Change the minimum length of slash commands to 1 (#284) * Change the minimum length of slash commands to 1. This is the correct value according to the docs and it has been changed after user feedback. * Fix the limit in 3 other places Co-authored-by: quin lynch --- .../Interactions/ContextMenus/MessageCommandBuilder.cs | 2 +- .../Entities/Interactions/ContextMenus/UserCommandBuilder.cs | 2 +- src/Discord.Net.Rest/DiscordRestApiClient.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/ContextMenus/MessageCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/ContextMenus/MessageCommandBuilder.cs index 61b599fcd..def5b9c3a 100644 --- a/src/Discord.Net.Core/Entities/Interactions/ContextMenus/MessageCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/ContextMenus/MessageCommandBuilder.cs @@ -19,7 +19,7 @@ namespace Discord set { Preconditions.NotNullOrEmpty(value, nameof(Name)); - Preconditions.AtLeast(value.Length, 3, nameof(Name)); + Preconditions.AtLeast(value.Length, 1, nameof(Name)); Preconditions.AtMost(value.Length, MaxNameLength, nameof(Name)); _name = value; diff --git a/src/Discord.Net.Core/Entities/Interactions/ContextMenus/UserCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/ContextMenus/UserCommandBuilder.cs index 67bd5ad48..9af02a027 100644 --- a/src/Discord.Net.Core/Entities/Interactions/ContextMenus/UserCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/ContextMenus/UserCommandBuilder.cs @@ -19,7 +19,7 @@ namespace Discord set { Preconditions.NotNullOrEmpty(value, nameof(Name)); - Preconditions.AtLeast(value.Length, 3, nameof(Name)); + Preconditions.AtLeast(value.Length, 1, nameof(Name)); Preconditions.AtMost(value.Length, MaxNameLength, nameof(Name)); _name = value; diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index af6e030cb..0675c1511 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -1187,7 +1187,7 @@ namespace Discord.API { Preconditions.NotNull(command, nameof(command)); Preconditions.AtMost(command.Name.Length, 32, nameof(command.Name)); - Preconditions.AtLeast(command.Name.Length, 3, nameof(command.Name)); + Preconditions.AtLeast(command.Name.Length, 1, nameof(command.Name)); if (command.Type == ApplicationCommandType.Slash) { @@ -1258,7 +1258,7 @@ namespace Discord.API { Preconditions.NotNull(command, nameof(command)); Preconditions.AtMost(command.Name.Length, 32, nameof(command.Name)); - Preconditions.AtLeast(command.Name.Length, 3, nameof(command.Name)); + Preconditions.AtLeast(command.Name.Length, 1, nameof(command.Name)); if (command.Type == ApplicationCommandType.Slash) {