From 234b2b4bdfd5dc505ae7ac3ba03be14cdaa66285 Mon Sep 17 00:00:00 2001 From: Nicholas Lambourne Date: Fri, 31 May 2024 15:58:33 +1000 Subject: [PATCH 1/3] [RELEASE] Release 1.0.9 --- docs_src/index.md | 22 +++++++++---------- pyproject.toml | 2 +- slackblocks/attachments.py | 4 ++-- slackblocks/blocks.py | 16 +++++++------- slackblocks/elements.py | 36 +++++++++++++++---------------- slackblocks/messages.py | 10 ++++----- slackblocks/modals.py | 2 +- slackblocks/objects.py | 2 +- slackblocks/rich_text/elements.py | 4 ++-- slackblocks/rich_text/objects.py | 6 +++--- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/docs_src/index.md b/docs_src/index.md index c1f9ad2..93c6e52 100644 --- a/docs_src/index.md +++ b/docs_src/index.md @@ -20,33 +20,33 @@ The [Slack BlockKit API](https://api.slack.com/block-kit) defines a number of classes that represent these resources. ### Objects -[`Objects`](/reference/objects) (e.g. [`Text`](/reference/objects/#objects.Text)) +[`Objects`](/slackblocks/latest/reference/messages/objects) (e.g. [`Text`](/slackblocks/latest/reference/messages/objects/#objects.Text)) are the lowest level pimitives that are used to populate - [`Elements`](/reference/elements) and [`Blocks`](/reference/blocks). + [`Elements`](/slackblocks/latest/reference/messages/elements) and [`Blocks`](/slackblocks/latest/reference/messages/blocks). ### Elements -[`Elements`](/reference/elements) are typically interactive UI elements that take - in [`Object`](/reference/objects) to define their content. For example, the +[`Elements`](/slackblocks/latest/reference/messages/elements) are typically interactive UI elements that take + in [`Object`](/slackblocks/latest/reference/messages/objects) to define their content. For example, the [`CheckboxGroup`](/elements/#elements.CheckboxGroup) element takes in one or - more [`Option`](/reference/objects/#objects.Option) items and presents a + more [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) items and presents a checkbox menu to the user with those options. ### Blocks -[`Blocks`](/reference/blocks) are the core element of the API, with different - [`Blocks`](/reference/blocks) used to create different types of visual - elements. For example, the [`DividerBlock`](/reference/blocks/#blocks.DividerBlock), +[`Blocks`](/slackblocks/latest/reference/messages/blocks) are the core element of the API, with different + [`Blocks`](/slackblocks/latest/reference/messages/blocks) used to create different types of visual + elements. For example, the [`DividerBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.DividerBlock), when rendered, will show a visual element similar to a `
` HTML element. The - [`RichTextBlock`](/reference/blocks/#blocks.RichTextBlock) on the other hand + [`RichTextBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock) on the other hand allows for the display of text elements with visual styling like italics, block quotes, lists and code blocks. ### Messages -[`Messages`](/reference/messages/) are a convenience wrapper around `Blocks` that +[`Messages`](/slackblocks/latest/reference/messages/messages/) are a convenience wrapper around `Blocks` that can be unpacked as arguments straight into the official Slack Python SDK (or its legacy `slackclient` counterpart). ### Views -[`Views`](reference/views/) are an alternative usage for [`Blocks`](/reference/blocks) +[`Views`](reference/views/) are an alternative usage for [`Blocks`](/slackblocks/latest/reference/messages/blocks) that allow for the creation of custom UI "surfaces" within Slack, e.g. for third-party apps. diff --git a/pyproject.toml b/pyproject.toml index b842b50..d9f68d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "slackblocks" -version = "1.0.8" +version = "1.0.9" description = "Python wrapper for the Slack Blocks API" authors = [ "Nicholas Lambourne ", diff --git a/slackblocks/attachments.py b/slackblocks/attachments.py index af967b4..c018026 100644 --- a/slackblocks/attachments.py +++ b/slackblocks/attachments.py @@ -2,7 +2,7 @@ Secondary (less important) content can be attached using the deprecated attachments API. -See: . +See: . """ from enum import Enum @@ -19,7 +19,7 @@ class Color(Enum): Color is a utility class for use with the Slack secondary attachments API. Pass these to the `color` argument of - [`Attachment`](/reference/attachments/#attachments.Attachment). + [`Attachment`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment). diff --git a/slackblocks/blocks.py b/slackblocks/blocks.py index 55ad761..28f6aac 100644 --- a/slackblocks/blocks.py +++ b/slackblocks/blocks.py @@ -114,7 +114,7 @@ class ActionsBlock(Block): A `Block` that is used to hold interactive elements (normally for users to interface with). Args: - elements: a list of [Elements](/reference/elements) (up to a maximum of 25). + elements: a list of [Elements](/slackblocks/latest/reference/messages/elements) (up to a maximum of 25). block_id: you can use this field to provide a deterministic identifier for the block. Throws: @@ -304,8 +304,8 @@ class InputBlock(Block): Args: label: the name which identifies the input field. - element: an interactive [Element](/reference/elements) (e.g. a text field). - dispatch_action: whether the [Element](/reference/elements) should trigger the + element: an interactive [Element](/slackblocks/latest/reference/messages/elements) (e.g. a text field). + dispatch_action: whether the [Element](/slackblocks/latest/reference/messages/elements) should trigger the sending of a `block_actions` payload. block_id: you can use this field to provide a deterministic identifier for the block. hint: an optional additional guide on what input the user should prodive. @@ -354,13 +354,13 @@ class RichTextBlock(Block): """ A RichTextBlock is used to provide easier rich text formatting than standard markdown text (e.g. in a - [`SectionBlock`](/reference/blocks/#blocks.SectionBlock)) + [`SectionBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.SectionBlock)) and access to text formatting features not available in traditional markdown (e.g. strikethrough). See the various rich text elements - you can include [here](/reference/rich_text). + you can include [here](/slackblocks/latest/reference/messages/rich_text). Args: - elements: a single [rich text element](../../reference/rich_text) + elements: a single [rich text element](rich_text) or a list of those elements. block_id: you can use this field to provide a deterministic identifier for the block. @@ -400,7 +400,7 @@ class SectionBlock(Block): available block elements. Section blocks can also optionally be given an "accessory," - which is typically one of the interactive [Elements](/reference/elements). + which is typically one of the interactive [Elements](/slackblocks/latest/reference/messages/elements). Args: text: text to include in the block. Can be a string or `Text` object (of either @@ -408,7 +408,7 @@ class SectionBlock(Block): `text` or `fields` must be provided. block_id: you can use this field to provide a deterministic identifier for the block. fields: a list of text objects. One of either `text` or `fields` must be provided. - accessory: an optional [Element](/reference/elements) object that will take a + accessory: an optional [Element](/slackblocks/latest/reference/messages/elements) object that will take a secondary place in the block (after or to the side of `text` or `fields`). Throws: diff --git a/slackblocks/elements.py b/slackblocks/elements.py index dde7944..04ca616 100644 --- a/slackblocks/elements.py +++ b/slackblocks/elements.py @@ -165,10 +165,10 @@ class CheckboxGroup(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/reference/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form the content of the checkbox group. initial_options: a list of - [`Option`](/reference/objects/#objects.Option) objects that will be + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when the checkbox group is used. @@ -423,7 +423,7 @@ class Image(Element): alt_text: a plain-text-only summary of the content of the image. image_url: a URL for a publicly hosted image (the user must provide either `image_url` or `slack_file`). - slack_file: a [`SlackFile`](/reference/objects/#objects.SlackFile) + slack_file: a [`SlackFile`](/slackblocks/latest/reference/messages/objects/#objects.SlackFile) (the user must provide either `image_url` or `slack_file`). Throws: @@ -465,14 +465,14 @@ class StaticMultiSelectMenu(Element): Args: action_id: an identifier so the source of the action can be known. - options: a list of [`Options`](/reference/objects/#objects.Option) + options: a list of [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) (max 100). Only one of `options` or `option_groups` must be provided. option_groups: a list of - [`OptionGroups`](/reference/objects/#objects.OptionGroup) + [`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup) (max 100). Only one of `options` or `option_groups` can be provided. - initial_options: the [`Options`](/reference/objects/#objects.Option) + initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) to be intially selected when the element is first rendered. confirm: a `ConfirmationDialogue` object that will be presented when the menu is used. @@ -592,7 +592,7 @@ class ExternalMultiSelectMenu(Element): action_id: an identifier so the source of the action can be known. min_query_length: minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). - initial_options: the [`Options`](/reference/objects/#objects.Option) + initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) to be intially selected when the element is first rendered. confirm: a `ConfirmationDialogue` object that will be presented when the menu is used. @@ -729,7 +729,7 @@ class ConversationMultiSelectMenu(Element): the menu is used. max_selected_items: the maximum number of items that can be selected in the menu. - filter: a [`Filter`](/reference/objects/#objects.ConversationFilter) + filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter) object that filters out conversations that don't match the settings of the filter. focus_on_load: whether or not the menu will be set to autofocus @@ -952,7 +952,7 @@ class OverflowMenu(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/reference/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form the content of the overflow menu. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1064,10 +1064,10 @@ class RadioButtonGroup(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/reference/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form the content of the radio button group. initial_option: an - [`Option`](/reference/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1122,14 +1122,14 @@ class StaticSelectMenu(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/reference/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form the content of the menu (max 100). option_groups: a list of - [`OptionGroups`](/reference/objects/#objects.OptionGroup) + [`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup) (max 100). Only one of `options` or `option_groups` can be provided. initial_option: an - [`Option`](/reference/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1225,12 +1225,12 @@ class ExternalSelectMenu(Element): """ A select menu interactive UI element, sourced with externally provided options. - See: . + See: . Args: action_id: an identifier so the source of the action can be known. initial_option: an - [`Option`](/reference/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be initially selected when first presented to the user. min_query_length: minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). @@ -1355,7 +1355,7 @@ class ConversationSelectMenu(Element): response_url_enabled: When set to true, the view_submission payload from the menu's parent view will contain a response_url. (This response_url can be used for message responses). - filter: a [`Filter`](/reference/objects/#objects.ConversationFilter) + filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter) object that filters out conversations that don't match the settings of the filter. focus_on_load: whether or not the input will be set to autofocus @@ -1625,7 +1625,7 @@ class WorkflowButton(Element): Args: text: the text content that will appear in the button. - workflow: a [`Workflow`](/reference/objects/#objects.Workflow) object + workflow: a [`Workflow`](/slackblocks/latest/reference/messages/objects/#objects.Workflow) object that contains details about the workflow that will run when the button is clicked. style: one of `Default`, `Primary`, or `Danger`, determines the diff --git a/slackblocks/messages.py b/slackblocks/messages.py index 26b5606..6c0a036 100644 --- a/slackblocks/messages.py +++ b/slackblocks/messages.py @@ -99,10 +99,10 @@ class Message(BaseMessage): channel: the Slack channel to send the message to, e.g. "#general". text: markdown text to send in the message. If `blocks` are provided then this is a fallback to display in notifications. - blocks: a list of [`Blocks`](/reference/blocks) to form the contents + blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents of the message instead of the contents of `text`. attachments: a list of - [`Attachments`](/reference/attachments/#attachments.Attachment) + [`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment) that form the secondary contents of the message (deprecated). thread_ts: the timestamp ID of another unthreaded message that will become the parent message of this message (now a reply in a thread). @@ -114,7 +114,7 @@ class Message(BaseMessage): automatically unfurl. Throws: InvalidUsageException: in the event that the items passed to `blocks` - are not valid [`Blocks`](/reference/blocks). + are not valid [`Blocks`](/slackblocks/latest/reference/messages/blocks). """ def __init__( @@ -184,9 +184,9 @@ class WebhookMessage: text: markdown text to send in the message. If `blocks` are provided then this is a fallback to display in notifications. attachments: a list of - [`Attachments`](/reference/attachments/#attachments.Attachment) + [`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment) that form the secondary contents of the message (deprecated). - blocks: a list of [`Blocks`](/reference/blocks) to form the contents + blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents of the message instead of the contents of `text`. response_type: one of `ResponseType.EPHEMERAL` or `ResponseType.IN_CHANNEL`. Ephemeral messages are shown only to the requesting user whereas diff --git a/slackblocks/modals.py b/slackblocks/modals.py index 5ec9bf1..a0850a6 100644 --- a/slackblocks/modals.py +++ b/slackblocks/modals.py @@ -16,7 +16,7 @@ class Modal(ModalView): """ - Kept for backwards compatibility - see [`ModalView`](/reference/views/#views.ModalView) + Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/messages/views/#views.ModalView) """ def __repr__(self) -> str: diff --git a/slackblocks/objects.py b/slackblocks/objects.py index f6abd5c..9c33550 100644 --- a/slackblocks/objects.py +++ b/slackblocks/objects.py @@ -221,7 +221,7 @@ class Confirm(ConfirmationDialogue): """ Alias for `ConfirmationDialogue` to retain backwards compatibility. - See: [`ConfirmationDialogue`](/reference/objects/#objects.ConfirmationDialogue). + See: [`ConfirmationDialogue`](/slackblocks/latest/reference/messages/objects/#objects.ConfirmationDialogue). """ def __init__(self, *args, **kwargs): diff --git a/slackblocks/rich_text/elements.py b/slackblocks/rich_text/elements.py index 3061104..9745c12 100644 --- a/slackblocks/rich_text/elements.py +++ b/slackblocks/rich_text/elements.py @@ -238,7 +238,7 @@ def _resolve(self) -> Dict[str, Any]: class RichTextUser(RichTextElement): """ Rich text element for representing users in - [`RichTextBlocks`](reference/blocks/#blocks.RichTextBlock). + [`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock). See: . @@ -297,7 +297,7 @@ def _resolve(self) -> Dict[str, Any]: class RichTextUserGroup(RichTextElement): """ Rich text element for representing groups of users in - [`RichTextBlocks`](reference/blocks/#blocks.RichTextBlock)`. + [`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock)`. See: . diff --git a/slackblocks/rich_text/objects.py b/slackblocks/rich_text/objects.py index f7f13e6..974e0d5 100644 --- a/slackblocks/rich_text/objects.py +++ b/slackblocks/rich_text/objects.py @@ -69,7 +69,7 @@ class RichTextSection(RichTextObject): """ The most basic rich text container object, which takes rich text elements and renders them when `RichTextSection` is passed to a - [`RichTextBlock`](/reference/blocks/#blocks.RichTextBlock). + [`RichTextBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock). See: . @@ -167,7 +167,7 @@ class RichTextCodeBlock(RichTextObject): Args: elements: one or more rich text primitive objexts - (e.g. [`RichText`](/reference/rich_text/#rich_text.RichText)). + (e.g. [`RichText`](/slackblocks/latest/reference/messages/rich_text/#rich_text.RichText)). border: the thickness (in pixels) of the border around the code block. Throws: @@ -213,7 +213,7 @@ class RichTextQuote(RichTextObject): Args: elements: one or more rich text primitive objexts - (e.g. [`RichText`](/reference/rich_text/#rich_text.RichText)). + (e.g. [`RichText`](/slackblocks/latest/reference/messages/rich_text/#rich_text.RichText)). border: the thickness (in pixels) of the border around the code block. """ From 1374598f767f50e975a08058f7ea9ebc16cf9781 Mon Sep 17 00:00:00 2001 From: Nicholas Lambourne Date: Fri, 31 May 2024 16:02:22 +1000 Subject: [PATCH 2/3] . --- docs_src/index.md | 22 +++++++++---------- slackblocks/attachments.py | 4 ++-- slackblocks/blocks.py | 14 ++++++------ slackblocks/elements.py | 36 +++++++++++++++---------------- slackblocks/messages.py | 10 ++++----- slackblocks/modals.py | 2 +- slackblocks/objects.py | 2 +- slackblocks/rich_text/elements.py | 4 ++-- slackblocks/rich_text/objects.py | 6 +++--- 9 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs_src/index.md b/docs_src/index.md index 93c6e52..959246e 100644 --- a/docs_src/index.md +++ b/docs_src/index.md @@ -20,33 +20,33 @@ The [Slack BlockKit API](https://api.slack.com/block-kit) defines a number of classes that represent these resources. ### Objects -[`Objects`](/slackblocks/latest/reference/messages/objects) (e.g. [`Text`](/slackblocks/latest/reference/messages/objects/#objects.Text)) +[`Objects`](/slackblocks/latest/reference/objects) (e.g. [`Text`](/slackblocks/latest/reference/objects/#objects.Text)) are the lowest level pimitives that are used to populate - [`Elements`](/slackblocks/latest/reference/messages/elements) and [`Blocks`](/slackblocks/latest/reference/messages/blocks). + [`Elements`](/slackblocks/latest/reference/elements) and [`Blocks`](/slackblocks/latest/reference/blocks). ### Elements -[`Elements`](/slackblocks/latest/reference/messages/elements) are typically interactive UI elements that take - in [`Object`](/slackblocks/latest/reference/messages/objects) to define their content. For example, the +[`Elements`](/slackblocks/latest/reference/elements) are typically interactive UI elements that take + in [`Object`](/slackblocks/latest/reference/objects) to define their content. For example, the [`CheckboxGroup`](/elements/#elements.CheckboxGroup) element takes in one or - more [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) items and presents a + more [`Option`](/slackblocks/latest/reference/objects/#objects.Option) items and presents a checkbox menu to the user with those options. ### Blocks -[`Blocks`](/slackblocks/latest/reference/messages/blocks) are the core element of the API, with different - [`Blocks`](/slackblocks/latest/reference/messages/blocks) used to create different types of visual - elements. For example, the [`DividerBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.DividerBlock), +[`Blocks`](/slackblocks/latest/reference/blocks) are the core element of the API, with different + [`Blocks`](/slackblocks/latest/reference/blocks) used to create different types of visual + elements. For example, the [`DividerBlock`](/slackblocks/latest/reference/blocks/#blocks.DividerBlock), when rendered, will show a visual element similar to a `
` HTML element. The - [`RichTextBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock) on the other hand + [`RichTextBlock`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock) on the other hand allows for the display of text elements with visual styling like italics, block quotes, lists and code blocks. ### Messages -[`Messages`](/slackblocks/latest/reference/messages/messages/) are a convenience wrapper around `Blocks` that +[`Messages`](/slackblocks/latest/reference/messages/) are a convenience wrapper around `Blocks` that can be unpacked as arguments straight into the official Slack Python SDK (or its legacy `slackclient` counterpart). ### Views -[`Views`](reference/views/) are an alternative usage for [`Blocks`](/slackblocks/latest/reference/messages/blocks) +[`Views`](reference/views/) are an alternative usage for [`Blocks`](/slackblocks/latest/reference/blocks) that allow for the creation of custom UI "surfaces" within Slack, e.g. for third-party apps. diff --git a/slackblocks/attachments.py b/slackblocks/attachments.py index c018026..6e8b928 100644 --- a/slackblocks/attachments.py +++ b/slackblocks/attachments.py @@ -2,7 +2,7 @@ Secondary (less important) content can be attached using the deprecated attachments API. -See: . +See: . """ from enum import Enum @@ -19,7 +19,7 @@ class Color(Enum): Color is a utility class for use with the Slack secondary attachments API. Pass these to the `color` argument of - [`Attachment`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment). + [`Attachment`](/slackblocks/latest/reference/attachments/#attachments.Attachment).
diff --git a/slackblocks/blocks.py b/slackblocks/blocks.py index 28f6aac..3eb2482 100644 --- a/slackblocks/blocks.py +++ b/slackblocks/blocks.py @@ -114,7 +114,7 @@ class ActionsBlock(Block): A `Block` that is used to hold interactive elements (normally for users to interface with). Args: - elements: a list of [Elements](/slackblocks/latest/reference/messages/elements) (up to a maximum of 25). + elements: a list of [Elements](/slackblocks/latest/reference/elements) (up to a maximum of 25). block_id: you can use this field to provide a deterministic identifier for the block. Throws: @@ -304,8 +304,8 @@ class InputBlock(Block): Args: label: the name which identifies the input field. - element: an interactive [Element](/slackblocks/latest/reference/messages/elements) (e.g. a text field). - dispatch_action: whether the [Element](/slackblocks/latest/reference/messages/elements) should trigger the + element: an interactive [Element](/slackblocks/latest/reference/elements) (e.g. a text field). + dispatch_action: whether the [Element](/slackblocks/latest/reference/elements) should trigger the sending of a `block_actions` payload. block_id: you can use this field to provide a deterministic identifier for the block. hint: an optional additional guide on what input the user should prodive. @@ -354,10 +354,10 @@ class RichTextBlock(Block): """ A RichTextBlock is used to provide easier rich text formatting than standard markdown text (e.g. in a - [`SectionBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.SectionBlock)) + [`SectionBlock`](/slackblocks/latest/reference/blocks/#blocks.SectionBlock)) and access to text formatting features not available in traditional markdown (e.g. strikethrough). See the various rich text elements - you can include [here](/slackblocks/latest/reference/messages/rich_text). + you can include [here](/slackblocks/latest/reference/rich_text). Args: elements: a single [rich text element](rich_text) @@ -400,7 +400,7 @@ class SectionBlock(Block): available block elements. Section blocks can also optionally be given an "accessory," - which is typically one of the interactive [Elements](/slackblocks/latest/reference/messages/elements). + which is typically one of the interactive [Elements](/slackblocks/latest/reference/elements). Args: text: text to include in the block. Can be a string or `Text` object (of either @@ -408,7 +408,7 @@ class SectionBlock(Block): `text` or `fields` must be provided. block_id: you can use this field to provide a deterministic identifier for the block. fields: a list of text objects. One of either `text` or `fields` must be provided. - accessory: an optional [Element](/slackblocks/latest/reference/messages/elements) object that will take a + accessory: an optional [Element](/slackblocks/latest/reference/elements) object that will take a secondary place in the block (after or to the side of `text` or `fields`). Throws: diff --git a/slackblocks/elements.py b/slackblocks/elements.py index 04ca616..ed41798 100644 --- a/slackblocks/elements.py +++ b/slackblocks/elements.py @@ -165,10 +165,10 @@ class CheckboxGroup(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form the content of the checkbox group. initial_options: a list of - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will be + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when the checkbox group is used. @@ -423,7 +423,7 @@ class Image(Element): alt_text: a plain-text-only summary of the content of the image. image_url: a URL for a publicly hosted image (the user must provide either `image_url` or `slack_file`). - slack_file: a [`SlackFile`](/slackblocks/latest/reference/messages/objects/#objects.SlackFile) + slack_file: a [`SlackFile`](/slackblocks/latest/reference/objects/#objects.SlackFile) (the user must provide either `image_url` or `slack_file`). Throws: @@ -465,14 +465,14 @@ class StaticMultiSelectMenu(Element): Args: action_id: an identifier so the source of the action can be known. - options: a list of [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) + options: a list of [`Options`](/slackblocks/latest/reference/objects/#objects.Option) (max 100). Only one of `options` or `option_groups` must be provided. option_groups: a list of - [`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup) + [`OptionGroups`](/slackblocks/latest/reference/objects/#objects.OptionGroup) (max 100). Only one of `options` or `option_groups` can be provided. - initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) + initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option) to be intially selected when the element is first rendered. confirm: a `ConfirmationDialogue` object that will be presented when the menu is used. @@ -592,7 +592,7 @@ class ExternalMultiSelectMenu(Element): action_id: an identifier so the source of the action can be known. min_query_length: minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). - initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option) + initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option) to be intially selected when the element is first rendered. confirm: a `ConfirmationDialogue` object that will be presented when the menu is used. @@ -729,7 +729,7 @@ class ConversationMultiSelectMenu(Element): the menu is used. max_selected_items: the maximum number of items that can be selected in the menu. - filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter) + filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter) object that filters out conversations that don't match the settings of the filter. focus_on_load: whether or not the menu will be set to autofocus @@ -952,7 +952,7 @@ class OverflowMenu(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form the content of the overflow menu. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1064,10 +1064,10 @@ class RadioButtonGroup(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form the content of the radio button group. initial_option: an - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1122,14 +1122,14 @@ class StaticSelectMenu(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form the content of the menu (max 100). option_groups: a list of - [`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup) + [`OptionGroups`](/slackblocks/latest/reference/objects/#objects.OptionGroup) (max 100). Only one of `options` or `option_groups` can be provided. initial_option: an - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when an option in the overflow menu is selected. @@ -1225,12 +1225,12 @@ class ExternalSelectMenu(Element): """ A select menu interactive UI element, sourced with externally provided options. - See: . + See: . Args: action_id: an identifier so the source of the action can be known. initial_option: an - [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be initially selected when first presented to the user. min_query_length: minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). @@ -1355,7 +1355,7 @@ class ConversationSelectMenu(Element): response_url_enabled: When set to true, the view_submission payload from the menu's parent view will contain a response_url. (This response_url can be used for message responses). - filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter) + filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter) object that filters out conversations that don't match the settings of the filter. focus_on_load: whether or not the input will be set to autofocus @@ -1625,7 +1625,7 @@ class WorkflowButton(Element): Args: text: the text content that will appear in the button. - workflow: a [`Workflow`](/slackblocks/latest/reference/messages/objects/#objects.Workflow) object + workflow: a [`Workflow`](/slackblocks/latest/reference/objects/#objects.Workflow) object that contains details about the workflow that will run when the button is clicked. style: one of `Default`, `Primary`, or `Danger`, determines the diff --git a/slackblocks/messages.py b/slackblocks/messages.py index 6c0a036..cb08d03 100644 --- a/slackblocks/messages.py +++ b/slackblocks/messages.py @@ -99,10 +99,10 @@ class Message(BaseMessage): channel: the Slack channel to send the message to, e.g. "#general". text: markdown text to send in the message. If `blocks` are provided then this is a fallback to display in notifications. - blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents + blocks: a list of [`Blocks`](/slackblocks/latest/reference/blocks) to form the contents of the message instead of the contents of `text`. attachments: a list of - [`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment) + [`Attachments`](/slackblocks/latest/reference/attachments/#attachments.Attachment) that form the secondary contents of the message (deprecated). thread_ts: the timestamp ID of another unthreaded message that will become the parent message of this message (now a reply in a thread). @@ -114,7 +114,7 @@ class Message(BaseMessage): automatically unfurl. Throws: InvalidUsageException: in the event that the items passed to `blocks` - are not valid [`Blocks`](/slackblocks/latest/reference/messages/blocks). + are not valid [`Blocks`](/slackblocks/latest/reference/blocks). """ def __init__( @@ -184,9 +184,9 @@ class WebhookMessage: text: markdown text to send in the message. If `blocks` are provided then this is a fallback to display in notifications. attachments: a list of - [`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment) + [`Attachments`](/slackblocks/latest/reference/attachments/#attachments.Attachment) that form the secondary contents of the message (deprecated). - blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents + blocks: a list of [`Blocks`](/slackblocks/latest/reference/blocks) to form the contents of the message instead of the contents of `text`. response_type: one of `ResponseType.EPHEMERAL` or `ResponseType.IN_CHANNEL`. Ephemeral messages are shown only to the requesting user whereas diff --git a/slackblocks/modals.py b/slackblocks/modals.py index a0850a6..2eef5ff 100644 --- a/slackblocks/modals.py +++ b/slackblocks/modals.py @@ -16,7 +16,7 @@ class Modal(ModalView): """ - Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/messages/views/#views.ModalView) + Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/views/#views.ModalView) """ def __repr__(self) -> str: diff --git a/slackblocks/objects.py b/slackblocks/objects.py index 9c33550..f108d1d 100644 --- a/slackblocks/objects.py +++ b/slackblocks/objects.py @@ -221,7 +221,7 @@ class Confirm(ConfirmationDialogue): """ Alias for `ConfirmationDialogue` to retain backwards compatibility. - See: [`ConfirmationDialogue`](/slackblocks/latest/reference/messages/objects/#objects.ConfirmationDialogue). + See: [`ConfirmationDialogue`](/slackblocks/latest/reference/objects/#objects.ConfirmationDialogue). """ def __init__(self, *args, **kwargs): diff --git a/slackblocks/rich_text/elements.py b/slackblocks/rich_text/elements.py index 9745c12..ce6ea98 100644 --- a/slackblocks/rich_text/elements.py +++ b/slackblocks/rich_text/elements.py @@ -238,7 +238,7 @@ def _resolve(self) -> Dict[str, Any]: class RichTextUser(RichTextElement): """ Rich text element for representing users in - [`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock). + [`RichTextBlocks`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock). See: . @@ -297,7 +297,7 @@ def _resolve(self) -> Dict[str, Any]: class RichTextUserGroup(RichTextElement): """ Rich text element for representing groups of users in - [`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock)`. + [`RichTextBlocks`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock)`. See: . diff --git a/slackblocks/rich_text/objects.py b/slackblocks/rich_text/objects.py index 974e0d5..a71d8d7 100644 --- a/slackblocks/rich_text/objects.py +++ b/slackblocks/rich_text/objects.py @@ -69,7 +69,7 @@ class RichTextSection(RichTextObject): """ The most basic rich text container object, which takes rich text elements and renders them when `RichTextSection` is passed to a - [`RichTextBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock). + [`RichTextBlock`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock). See: . @@ -167,7 +167,7 @@ class RichTextCodeBlock(RichTextObject): Args: elements: one or more rich text primitive objexts - (e.g. [`RichText`](/slackblocks/latest/reference/messages/rich_text/#rich_text.RichText)). + (e.g. [`RichText`](/slackblocks/latest/reference/rich_text/#rich_text.RichText)). border: the thickness (in pixels) of the border around the code block. Throws: @@ -213,7 +213,7 @@ class RichTextQuote(RichTextObject): Args: elements: one or more rich text primitive objexts - (e.g. [`RichText`](/slackblocks/latest/reference/messages/rich_text/#rich_text.RichText)). + (e.g. [`RichText`](/slackblocks/latest/reference/rich_text/#rich_text.RichText)). border: the thickness (in pixels) of the border around the code block. """ From 1cd1a1f7a3b3051d923c3c3dc859b19a93f0e2a3 Mon Sep 17 00:00:00 2001 From: Nicholas Lambourne Date: Fri, 31 May 2024 16:12:38 +1000 Subject: [PATCH 3/3] . --- slackblocks/blocks.py | 18 +++++++++++------- slackblocks/elements.py | 14 ++++++++------ slackblocks/modals.py | 3 ++- slackblocks/objects.py | 3 ++- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/slackblocks/blocks.py b/slackblocks/blocks.py index 3eb2482..771c0cc 100644 --- a/slackblocks/blocks.py +++ b/slackblocks/blocks.py @@ -114,7 +114,8 @@ class ActionsBlock(Block): A `Block` that is used to hold interactive elements (normally for users to interface with). Args: - elements: a list of [Elements](/slackblocks/latest/reference/elements) (up to a maximum of 25). + elements: a list of [Elements](/slackblocks/latest/reference/elements) + (up to a maximum of 25). block_id: you can use this field to provide a deterministic identifier for the block. Throws: @@ -304,9 +305,10 @@ class InputBlock(Block): Args: label: the name which identifies the input field. - element: an interactive [Element](/slackblocks/latest/reference/elements) (e.g. a text field). - dispatch_action: whether the [Element](/slackblocks/latest/reference/elements) should trigger the - sending of a `block_actions` payload. + element: an interactive [Element](/slackblocks/latest/reference/elements) + (e.g. a text field). + dispatch_action: whether the [Element](/slackblocks/latest/reference/elements) + should trigger the sending of a `block_actions` payload. block_id: you can use this field to provide a deterministic identifier for the block. hint: an optional additional guide on what input the user should prodive. optional: whether this input field may be empty when the user submits e.g. the modal. @@ -400,7 +402,8 @@ class SectionBlock(Block): available block elements. Section blocks can also optionally be given an "accessory," - which is typically one of the interactive [Elements](/slackblocks/latest/reference/elements). + which is typically one of the interactive + [Elements](/slackblocks/latest/reference/elements). Args: text: text to include in the block. Can be a string or `Text` object (of either @@ -408,8 +411,9 @@ class SectionBlock(Block): `text` or `fields` must be provided. block_id: you can use this field to provide a deterministic identifier for the block. fields: a list of text objects. One of either `text` or `fields` must be provided. - accessory: an optional [Element](/slackblocks/latest/reference/elements) object that will take a - secondary place in the block (after or to the side of `text` or `fields`). + accessory: an optional [Element](/slackblocks/latest/reference/elements) object that + will take a secondary place in the block (after or to the side of `text` or + `fields`). Throws: InvalidUsageError: if any of the provided arguments fail validation checks. diff --git a/slackblocks/elements.py b/slackblocks/elements.py index ed41798..1f2fe56 100644 --- a/slackblocks/elements.py +++ b/slackblocks/elements.py @@ -165,11 +165,11 @@ class CheckboxGroup(Element): Args: action_id: an identifier so the source of the action can be known. options: a list of - [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form - the content of the checkbox group. + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will + form the content of the checkbox group. initial_options: a list of - [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will be - initially selected when first presented to the user. + [`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will + be initially selected when first presented to the user. confirm: a `ConfirmationDialogue` object that will be presented when the checkbox group is used. focus_on_load: whether or not the checkbox group will be set to autofocus @@ -423,7 +423,8 @@ class Image(Element): alt_text: a plain-text-only summary of the content of the image. image_url: a URL for a publicly hosted image (the user must provide either `image_url` or `slack_file`). - slack_file: a [`SlackFile`](/slackblocks/latest/reference/objects/#objects.SlackFile) + slack_file: a + [`SlackFile`](/slackblocks/latest/reference/objects/#objects.SlackFile) (the user must provide either `image_url` or `slack_file`). Throws: @@ -1225,7 +1226,8 @@ class ExternalSelectMenu(Element): """ A select menu interactive UI element, sourced with externally provided options. - See: . + See: + . # noqa: E501 Args: action_id: an identifier so the source of the action can be known. diff --git a/slackblocks/modals.py b/slackblocks/modals.py index 2eef5ff..15947fd 100644 --- a/slackblocks/modals.py +++ b/slackblocks/modals.py @@ -16,7 +16,8 @@ class Modal(ModalView): """ - Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/views/#views.ModalView) + Kept for backwards compatibility - see + [`ModalView`](/slackblocks/latest/reference/views/#views.ModalView) """ def __repr__(self) -> str: diff --git a/slackblocks/objects.py b/slackblocks/objects.py index f108d1d..b632aa4 100644 --- a/slackblocks/objects.py +++ b/slackblocks/objects.py @@ -221,7 +221,8 @@ class Confirm(ConfirmationDialogue): """ Alias for `ConfirmationDialogue` to retain backwards compatibility. - See: [`ConfirmationDialogue`](/slackblocks/latest/reference/objects/#objects.ConfirmationDialogue). + See: + [`ConfirmationDialogue`](/slackblocks/latest/reference/objects/#objects.ConfirmationDialogue). # noqa: E501 """ def __init__(self, *args, **kwargs):