# UpdateMessage

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Slack/tree/main/Frends.Slack.UpdateMessage>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                 | Description                                                                                                                                                                                                                                               |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ChannelId : `String` | <p>Channel ID where the message exists</p><p><br>Default: <code>-</code><br>Example: <code>C12345678</code></p>                                                                                                                                           |
| MessageTs : `String` | <p>Timestamp of the message to update</p><p><br>Default: <code>-</code><br>Example: <code>1234567890.123456</code></p>                                                                                                                                    |
| Mode : `MessageMode` | <p>Message format mode</p><p>Possible values:</p><ul><li><code>PlainText</code>:</li></ul><p>Message format mode</p><ul><li><code>Blocks</code>:</li></ul><p>Message format mode</p><p><br>Default: <code>-</code><br>Example: <code>PlainText</code></p> |
| Text : `String`      | <p>The plain text content (when Mode = PlainText)</p><p><br>Default: <code>-</code><br>Example: <code>Updated message text</code></p>                                                                                                                     |
| Blocks : `String`    | <p>Block Kit JSON (when Mode = Blocks)</p><p><br>Default: <code>-</code><br>Example: <code>\[{ "type": "section", "text": { "type": "mrkdwn", "text": "</code><em><code>Updated</code></em><code> content" } }]</code></p>                                |
| {% endtab %}         |                                                                                                                                                                                                                                                           |

{% tab title="Parameter: Connection" %}

| Name               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 🗝Token : `String` | <p>Slack OAuth token used for authentication.</p><p>If the token is a bot token (starts with "xoxb"), messages</p><p>will be updated as the Slack app's bot user.</p><p>If the token is a user token (starts with "xoxp"), messages</p><p>will be updated as the Slack user who authorized the token.</p><p>The token owner must be the original message poster</p><p>or have appropriate permissions to edit the message.</p><p>Note: User tokens require the user to have authorized the app via OAuth</p><p>with appropriate scopes (e.g., "chat:write").</p><p><br>Default: <code>-</code><br>Example: <code>xoxb-123456789</code></p> |
| {% endtab %}       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                                                                   |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UnfurlLinks : `Boolean`          | <p>Whether to expand URLs in the message into rich previews (e.g. YouTube, websites).</p><p>Note: Slack may unfurl a link only once per channel to reduce duplication.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| UnfurlMedia : `Boolean`          | <p>Whether to show media previews (e.g. images, video thumbnails) for links in the message.</p><p>Note: Media previews may appear only on first post of the same link.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ThrowErrorOnFailure : `Boolean`  | <p>True: Throw an exception.</p><p>False: Error will be added to the Result.Error.AdditionalInfo list instead of stopping the Task.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                    |
| ErrorMessageOnFailure : `String` | <p>Message what will be used when error occurs.</p><p><br>Default: <code>Failed to update message</code><br>Example: <code>Task failed during execution</code></p>                                                                            |
| {% endtab %}                     |                                                                                                                                                                                                                                               |

{% tab title="Result: Result" %}

| Name                 | Description                                                                                                                                                                                      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`  | <p>Indicates whether the message was updated successfully.<br>Example: <code>true</code></p>                                                                                                     |
| MessageTs : `String` | <p>The timestamp (ID) of the updated message.<br>Example: <code>1234567890.123456</code></p>                                                                                                     |
| Error : `Error`      | <p>Error that occurred during task execution.<br>Example: <code>{ Message = "Failed to update Slack message.", AdditionalInfo = new Exception("Slack API returned 400 Bad Request") }</code></p> |
| {% endtab %}         |                                                                                                                                                                                                  |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-03-04

#### Fixed

* Blocks JSON string is now correctly parsed to JArray before sending to Slack API.
* \[Breaking change] - Input.Blocks type changed from JArray to string. Users should now provide raw JSON string instead of parsed JArray.

### \[1.0.0] - 2025-06-09

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
