# GetChannelMessages

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

{% 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>                                |
| Limit : `Nullable<Int32>` | <p>Maximum number of messages to retrieve</p><p><br>Default: <code>-</code><br>Example: <code>100</code></p>                                   |
| Latest : `String`         | <p>Fetch messages before this timestamp (used for pagination)</p><p><br>Default: <code>-</code><br>Example: <code>1623878400.000200</code></p> |
| Oldest : `String`         | <p>Fetch messages after this timestamp (used for pagination)</p><p><br>Default: <code>-</code><br>Example: <code>1623792000.000100</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                                                                                                                    |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| IncludeThreads : `Boolean`       | <p>Whether to include thread replies</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                  |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>               |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p> |
| {% endtab %}                     |                                                                                                                                |

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

| Name                       | Description                                                                                                                                         |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`        | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                                                  |
| Messages : `List<Message>` | List of messages retrieved from the channel                                                                                                         |
| HasMore : `Boolean`        | <p>Whether more messages are available for pagination<br>Example: <code>true</code></p>                                                             |
| Error : `Error`            | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, object { Exception Exception } AdditionalInfo }</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-07-30

#### Added

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