# Get Channels

> Retrieve a Discord server's channels by its ID.

- ID: `get_discord_guild_channels`
- Type: Loop
- Category: [Channels](https://inventor.bot/docs/reference/blocks/channels.md)

- Loop block: write `for item := range get_discord_guild_channels(Args{...}) { ... }` and read the current item's outputs from `item`. See loops.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `server_id` | yes | ID of the server to retrieve channels from. |  |
| `body` |  | Blocks to run for each channel. | blocks: `func() { ... }` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `iteration_number` | Current iteration (1-based). | e.g. `"1"` |
| `total_iterations` | Total number of iterations. | e.g. `"5"` |
| `channel_id` | ID of the channel. |  |
| `channel_name` | Name of the channel. |  |
| `channel_topic` | Topic of the channel. |  |
| `channel_position` | Position of the channel in the server. | e.g. `"3"` |
| `channel_type` | Type of channel (Text, Voice, etc.). |  |
| `channel_nsfw` | Whether the channel is marked NSFW. |  |
| `parent_channel_id` | ID of the parent category or thread owner. |  |
| `voice_channel_limit` | User limit for voice channels. | e.g. `"0"` |
| `channel_user_limit` | User limit for voice and stage channels. | e.g. `"0"` |
| `channel_link` | Link to the channel. | e.g. `"https://discord.com/channels/123/456"` |
| `last_message_id` | ID of the last message sent in the channel. |  |
| `applied_forum_tags` | Comma-separated applied forum tag IDs. |  |
| `available_forum_tags` | Comma-separated available forum tag IDs. |  |
| `channel_slow_mode` | Slowmode delay in seconds (0 means disabled). | e.g. `"0"` |

**Example**

```go
for guildChannel := range get_discord_guild_channels(Args{server_id: trigger.server_id}) {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "Channel ID: " + guildChannel.channel_id,
	})
}
```