# DeleteMessage

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.DeleteMessage>

{% 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 delete.</p><p><br>Default: <code>-</code><br>Example: <code>1234567890.123456</code></p> |
| {% endtab %}         |                                                                                                                         |

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

| Name               | Description                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 🗝Token : `String` | <p>Slack OAuth token used for authentication.</p><p>The token owner must be the original message poster</p><p>or have appropriate permissions to delete 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                                                                                                                                                                                                |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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 delete 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 deleted successfully.<br>Example: <code>true</code></p>                                                                                                     |
| MessageTs : `String` | <p>The timestamp (ID) of the deleted message.<br>Example: <code>1234567890.123456</code></p>                                                                                                     |
| Error : `Error`      | <p>Error that occurred during task execution.<br>Example: <code>{ Message = "Failed to delete Slack message.", AdditionalInfo = new Exception("Slack API returned 400 Bad Request") }</code></p> |
| {% endtab %}         |                                                                                                                                                                                                  |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2025-08-06

#### Changed

* Improved error handling
* Marked token as a password property

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

#### Added

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