From ea75a6df2c251b7ca34d5b3d8dfa9d71950f00d3 Mon Sep 17 00:00:00 2001
From: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
Date: Fri, 6 Aug 2021 20:46:41 -0400
Subject: [PATCH] Update label/description lengths for selects (ref:
https://github.com/discord/discord-api-docs/pull/3598/files) (#91)
https://github.com/discord/discord-api-docs/pull/3598/files
---
.../Message Components/ComponentBuilder.cs | 21 ++++++++++++-------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
index bb2f80a81..8d4a710ea 100644
--- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
@@ -13,7 +13,7 @@ namespace Discord
///
/// The max length of a .
///
- public const int MaxLabelLength = 80;
+ public const int MaxButtonLabelLength = 80;
///
/// The max length of a .
@@ -310,14 +310,14 @@ namespace Discord
///
/// Gets or sets the label of the current button.
///
- /// length exceeds .
+ /// length exceeds .
public string Label
{
get => _label;
set
{
- if (value != null && value.Length > ComponentBuilder.MaxLabelLength)
- throw new ArgumentException(message: $"Button label must be {ComponentBuilder.MaxLabelLength} characters or less!", paramName: nameof(Label));
+ if (value != null && value.Length > ComponentBuilder.MaxButtonLabelLength)
+ throw new ArgumentException(message: $"Button label must be {ComponentBuilder.MaxButtonLabelLength} characters or less!", paramName: nameof(Label));
_label = value;
}
@@ -834,20 +834,25 @@ namespace Discord
///
/// The maximum length of a .
///
- public const int MaxDescriptionLength = 50;
+ public const int MaxDescriptionLength = 100;
+
+ ///
+ /// The maximum length of a .
+ ///
+ public const int MaxSelectLabelLength = 100;
///
/// Gets or sets the label of the current select menu.
///
- /// length exceeds
+ /// length exceeds
public string Label
{
get => _label;
set
{
if (value != null)
- if (value.Length > ComponentBuilder.MaxLabelLength)
- throw new ArgumentException(message: $"Button label must be {ComponentBuilder.MaxLabelLength} characters or less!", paramName: nameof(Label));
+ if (value.Length > MaxSelectLabelLength)
+ throw new ArgumentException(message: $"Button label must be {MaxSelectLabelLength} characters or less!", paramName: nameof(Label));
_label = value;
}