L2 Construct: update_message
slack bot message updateDescription
UpdateMessage updates an existing message in a Slack channel.
Input:
- ChannelId: ID of the channel containing the message
- MessageTs: Timestamp of the message to update
- Blocks: Array of Slack blocks to replace the message content with
Output:
- Ok: Whether the update was successful
- Error: Error details if the update failed
L2 Data
- Provider: slack
- Module: bot
- Action: update_message
Example Step
{
"name": "insert-your-step-name",
"type": "l2",
"l2_data": {
"provider": "slack",
"module": "bot",
"action": "update_message",
"metadata": {}
}
}
Input
Example
{
"channel_id": "C01234567890",
"message_ts": "1234567890.000000",
"blocks": [
{
"type": "section"
}
]
}
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pontus.bpa/pkgs/l2/slack/update-message-input",
"$ref": "#/$defs/UpdateMessageInput",
"$defs": {
"Accessory": {
"properties": {
"type": {
"type": "string"
},
"style": {
"type": "string"
},
"text": {
"$ref": "#/$defs/TextObject"
},
"value": {
"type": "string"
},
"action_id": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": ["type", "action_id"]
},
"Block": {
"properties": {
"type": {
"type": "string"
},
"text": {
"$ref": "#/$defs/TextObject"
},
"fields": {
"items": {
"$ref": "#/$defs/TextObject"
},
"type": "array"
},
"accessory": {
"$ref": "#/$defs/Accessory"
},
"elements": {
"items": {
"$ref": "#/$defs/Accessory"
},
"type": "array"
},
"image_url": {
"type": "string"
},
"alt_text": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": ["type"]
},
"TextObject": {
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": ["type", "text"]
},
"UpdateMessageInput": {
"properties": {
"channel_id": {
"type": "string"
},
"message_ts": {
"type": "string"
},
"blocks": {
"items": {
"$ref": "#/$defs/Block"
},
"type": "array"
}
},
"additionalProperties": false,
"type": "object",
"required": ["channel_id", "message_ts", "blocks"]
}
}
}
Output
Example
{
"ok": true,
"error": {
"is_error": false
}
}
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pontus.bpa/pkgs/l2/slack/update-message-output",
"$ref": "#/$defs/UpdateMessageOutput",
"$defs": {
"HandlerError": {
"properties": {
"is_error": {
"type": "boolean"
},
"errors": {
"items": {
"type": "string"
},
"type": "array"
}
},
"additionalProperties": false,
"type": "object",
"required": ["is_error"]
},
"UpdateMessageOutput": {
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"$ref": "#/$defs/HandlerError"
}
},
"additionalProperties": false,
"type": "object",
"required": ["ok", "error"]
}
}
}