diff --git a/SlackNet/Blocks/DispatchActionConfig.cs b/SlackNet/Blocks/DispatchActionConfig.cs new file mode 100644 index 0000000..3807ae3 --- /dev/null +++ b/SlackNet/Blocks/DispatchActionConfig.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace SlackNet.Blocks +{ + /// + /// Determines when a element will return a interaction payload. + /// + public class DispatchActionConfig + { + /// + /// An array of that you would like to receive a payload for. + /// + [IgnoreIfEmpty] + public IList TriggerActionsOn { get; set; } = new List(); + } + + public enum InteractionType + { + OnEnterPressed, + OnCharacterEntered + } +} \ No newline at end of file diff --git a/SlackNet/Blocks/InputBlock.cs b/SlackNet/Blocks/InputBlock.cs index 82f429d..f4b9270 100644 --- a/SlackNet/Blocks/InputBlock.cs +++ b/SlackNet/Blocks/InputBlock.cs @@ -27,5 +27,10 @@ public InputBlock() : base("input") { } /// A boolean that indicates whether the input element may be empty when a user submits the modal. /// public bool Optional { get; set; } + + /// + /// A boolean that indicates whether or not the use of elements in this block should dispatch a payload. Defaults to false. + /// + public bool DispatchAction { get; set; } } } \ No newline at end of file diff --git a/SlackNet/Blocks/PlainTextInput.cs b/SlackNet/Blocks/PlainTextInput.cs index 492d1a8..c01c03a 100644 --- a/SlackNet/Blocks/PlainTextInput.cs +++ b/SlackNet/Blocks/PlainTextInput.cs @@ -37,6 +37,17 @@ public PlainTextInput() : base("plain_text_input") { } /// The maximum length of input that the user can provide. If the user provides more, they will receive an error. /// public int? MaxLength { get; set; } + + /// + /// A that determines when during text input the element returns a payload. + /// + public DispatchActionConfig DispatchActionConfig { get; set; } + } + + [SlackType("plain_text_input")] + public class PlainTextInputAction : BlockAction + { + public string Value { get; set; } } [SlackType("plain_text_input")]