Add message_attachment container type to SlackInteractionActionContainer (#341)

The Slack API defines three container types for interaction payloads:
message, message_attachment, and view. The message_attachment type is
used when interactive Block Kit elements are placed inside legacy
secondary attachments (the ones with the colored side stripe).

This adds the missing MessageAttachment variant with its
SlackInteractionActionMessageAttachmentContainer struct, which
includes the attachment_id field (1-based integer identifying which
attachment contains the interactive element).

Reference: https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/
This commit is contained in:
Nikolay Denev 2026-02-21 08:45:47 -06:00 committed by GitHub
parent 471e80f51b
commit c0d9446f43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,6 +61,8 @@ pub struct SlackInteractionBlockSuggestionEvent {
pub enum SlackInteractionActionContainer {
#[serde(rename = "message")]
Message(SlackInteractionActionMessageContainer),
#[serde(rename = "message_attachment")]
MessageAttachment(SlackInteractionActionMessageAttachmentContainer),
#[serde(rename = "view")]
View(SlackInteractionActionViewContainer),
}
@ -74,6 +76,16 @@ pub struct SlackInteractionActionMessageContainer {
pub is_app_unfurl: Option<bool>,
}
#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackInteractionActionMessageAttachmentContainer {
pub message_ts: SlackTs,
pub attachment_id: i64,
pub channel_id: Option<SlackChannelId>,
pub is_ephemeral: Option<bool>,
pub is_app_unfurl: Option<bool>,
}
#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackInteractionActionViewContainer {