mirror of
https://github.com/System-End/slack-morphism-rust.git
synced 2026-04-19 19:45:13 +00:00
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:
parent
471e80f51b
commit
c0d9446f43
1 changed files with 12 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue