channel_get
channel_get returns a single channel. Use it to refresh one channel without reloading the whole list.
The server also sends channel_get unrequested when one channel’s settings change, if your client reported the channel_get capability.
Request
Section titled “Request”{ "cmd": "channel_get", "channel": "general"}| Field | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Channel name. Case-sensitive. |
Response
Section titled “Response”{ "cmd": "channel_get", "val": { "name": "general", "type": "text", "display_name": "General", "permissions": { "view": ["user"], "send": ["user"] }, "last_message": 1788940000.31, "last_message_id": "4c1f7a2e-2b1d-4a44-9d0c-3f1f9b8e6a10", "last_message_by_user": null, "slow_mode_cooldown": 5 }}val is a channel object, in the same form as one entry of channels_get. The permissions object above is shortened.
When the server pushes an unrequested channel_get, replace the stored channel with the same name.
Permissions
Section titled “Permissions”Your roles must allow view on the channel.
Errors
Section titled “Errors”val |
When |
|---|---|
Channel not found |
No channel has this name. |
You do not have permission to view this channel |
Your roles can’t view the channel. |
A validation message is returned when channel is missing or empty.
