From 215a45e362730a1ae0156bda9c6dd8bbb03cf1e9 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 31 Oct 2019 14:31:51 -0700 Subject: [PATCH 1/2] max length must be greater than 1 --- Slack/Slack.BlockKit/Classes/Elements/PlainTextInput.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Slack/Slack.BlockKit/Classes/Elements/PlainTextInput.cs b/Slack/Slack.BlockKit/Classes/Elements/PlainTextInput.cs index 77d078d..33fff64 100644 --- a/Slack/Slack.BlockKit/Classes/Elements/PlainTextInput.cs +++ b/Slack/Slack.BlockKit/Classes/Elements/PlainTextInput.cs @@ -12,7 +12,7 @@ public class PlainTextInput : Element public string initial_value; public bool multiline; private uint _min_length; - private uint _max_length; + private uint _max_length = 100; private const int inputLengthMax = 3000; public PlainTextInput(string action_id) : base("plain_text_input") From 63cefee164059766c228179a7a9eee476a3f7932 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 1 Nov 2019 09:30:19 -0700 Subject: [PATCH 2/2] input blocks need block_ids too --- Slack/Slack.BlockKit/Classes/Layout/Input.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Slack/Slack.BlockKit/Classes/Layout/Input.cs b/Slack/Slack.BlockKit/Classes/Layout/Input.cs index e7ddb4f..80269aa 100644 --- a/Slack/Slack.BlockKit/Classes/Layout/Input.cs +++ b/Slack/Slack.BlockKit/Classes/Layout/Input.cs @@ -10,6 +10,8 @@ public class Input : Block private const int labelTextLength = 2000; private object _element; private PlainText _hint; + private string _block_id; + private const int block_idLength = 255; private const int hintTextLength = 2000; public bool optional; @@ -44,6 +46,18 @@ public object element } } } + + public string block_id + { + get => _block_id; set + { + if (value.Length > block_idLength) + { + throw new System.Exception($"block_id length must be less than {block_idLength} characters."); + } + _block_id = value; + } + } public PlainText hint { get => _hint; set