Channels and threads: read, modify and delete channels, permission overwrites, invites, guild channel creation and ordering, and the thread lifecycle (start, join, members, archives).

Calls that change a guild accept reason, recorded in the audit log.

Functions

add-thread-member

fn (request: AddThreadMemberRequest): Bool
fn (request: AddThreadMemberRequest, opts: Map): Bool

PUT /channels/{channel_id}/thread-members/{user_id} - Add a user to a thread. Needs SEND_MESSAGES_IN_THREADS.

Example

::channels ::discord::channels

::channels/add-thread-member(::channels/AddThreadMemberRequest({
  channel_id: "1100000000000000000",
  user_id: "1300000000000000000"
}))

create-channel-invite

fn (request: CreateChannelInviteRequest): Map
fn (request: CreateChannelInviteRequest, opts: Map): Map

POST /channels/{channel_id}/invites - Create an invite. max_age in seconds (0 = never, default 86400), max_uses (0 = unlimited), unique: true to skip reusing a similar invite. Needs CREATE_INSTANT_INVITE.

Example

::channels ::discord::channels

invite ::channels/create-channel-invite(::channels/CreateChannelInviteRequest({
  channel_id: "1100000000000000000",
  max_age: 3600,
  max_uses: 1,
  unique: true
}))
`https://discord.gg/${invite.code}`

create-guild-channel

fn (request: CreateGuildChannelRequest): Map
fn (request: CreateGuildChannelRequest, opts: Map): Map

POST /guilds/{guild_id}/channels - Create a channel. type: 0 text, 2 voice, 4 category, 5 announcement, 13 stage, 15 forum, 16 media. Needs MANAGE_CHANNELS.

Example

::channels ::discord::channels

::channels/create-guild-channel(::channels/CreateGuildChannelRequest({
  guild_id: "1000000000000000000",
  name: "incident-2026-11-01",
  type: 0,
  parent_id: "1400000000000000000",
  reason: "Incident channel"
}))

delete-channel

fn (request: DeleteChannelRequest): Map
fn (request: DeleteChannelRequest, opts: Map): Map

DELETE /channels/{channel_id} - Delete a guild channel or thread, or close a DM. Returns the deleted channel. Needs MANAGE_CHANNELS (MANAGE_THREADS for threads). Deleting a category leaves its channels in place.

Example

::channels ::discord::channels

deleted ::channels/delete-channel(::channels/DeleteChannelRequest({
  channel_id: "1100000000000000000",
  reason: "Incident closed"
}))
deleted.name

delete-channel-permission

fn (request: DeleteChannelPermissionRequest): Bool
fn (request: DeleteChannelPermissionRequest, opts: Map): Bool

DELETE /channels/{channel_id}/permissions/{overwrite_id} - Remove a role or member permission overwrite. Needs MANAGE_ROLES.

Example

::channels ::discord::channels

::channels/delete-channel-permission(::channels/DeleteChannelPermissionRequest({
  channel_id: "1100000000000000000",
  overwrite_id: "1000000000000000000",
  reason: "Back to category defaults"
}))

edit-channel-permissions

fn (request: EditChannelPermissionsRequest): Bool
fn (request: EditChannelPermissionsRequest, opts: Map): Bool

PUT /channels/{channel_id}/permissions/{overwrite_id} - Create or replace a permission overwrite for a role (type 0) or member (type 1). allow/deny are permission bit sets as strings; an omitted one defaults to "0". Needs MANAGE_ROLES.

Example

::channels ::discord::channels

// Hide the channel from @everyone (role id = guild id)
::channels/edit-channel-permissions(::channels/EditChannelPermissionsRequest({
  channel_id: "1100000000000000000",
  overwrite_id: "1000000000000000000",
  type: 0,
  deny: "1024"
}))

follow-announcement-channel

fn (request: FollowAnnouncementChannelRequest): Map
fn (request: FollowAnnouncementChannelRequest, opts: Map): Map

POST /channels/{channel_id}/followers - Follow an Announcement channel into webhook_channel_id. Needs MANAGE_WEBHOOKS in the target channel.

Example

::channels ::discord::channels

follow ::channels/follow-announcement-channel(::channels/FollowAnnouncementChannelRequest({
  channel_id: "1100000000000000000",
  webhook_channel_id: "1100000000000000001"
}))
follow.webhook_id

get-channel

fn (request: GetChannelRequest): Map
fn (request: GetChannelRequest, opts: Map): Map

GET /channels/{channel_id} - A channel or thread by id.

Example

::channels ::discord::channels

channel ::channels/get-channel(::channels/GetChannelRequest({channel_id: "1100000000000000000"}))
channel.name  // => "general"
channel.type  // => 0 (guild text)

get-channel-invites

fn (request: GetChannelInvitesRequest): Vec<Map>
fn (request: GetChannelInvitesRequest, opts: Map): Vec<Map>

GET /channels/{channel_id}/invites - Invites for a channel, with metadata. Needs MANAGE_CHANNELS.

Example

::channels ::discord::channels

invites ::channels/get-channel-invites(::channels/GetChannelInvitesRequest({channel_id: "1100000000000000000"}))
map(invites, %.code)

get-guild-channels

fn (request: GetGuildChannelsRequest): Vec<Map>
fn (request: GetGuildChannelsRequest, opts: Map): Vec<Map>

GET /guilds/{guild_id}/channels - Every channel in a guild (threads excluded; see list-active-threads).

Example

::channels ::discord::channels

channels ::channels/get-guild-channels(::channels/GetGuildChannelsRequest({guild_id: "1000000000000000000"}))
text-channels filter(channels, (c) { eq(c.type, 0) })

get-thread-member

fn (request: GetThreadMemberRequest): Map
fn (request: GetThreadMemberRequest, opts: Map): Map

GET /channels/{channel_id}/thread-members/{user_id} - One thread member; with_member: true adds the guild member object.

Example

::channels ::discord::channels

member ::channels/get-thread-member(::channels/GetThreadMemberRequest({
  channel_id: "1100000000000000000",
  user_id: "1300000000000000000",
  with_member: true
}))
member.join_timestamp

join-thread

fn (request: JoinThreadRequest): Bool
fn (request: JoinThreadRequest, opts: Map): Bool

PUT /channels/{channel_id}/thread-members/@me - Join a thread (it must not be archived).

Example

::channels ::discord::channels

::channels/join-thread(::channels/JoinThreadRequest({channel_id: "1100000000000000000"}))

leave-thread

fn (request: LeaveThreadRequest): Bool
fn (request: LeaveThreadRequest, opts: Map): Bool

DELETE /channels/{channel_id}/thread-members/@me - Leave a thread.

Example

::channels ::discord::channels

::channels/leave-thread(::channels/LeaveThreadRequest({channel_id: "1100000000000000000"}))

list-active-threads

fn (request: ListActiveThreadsRequest): Map
fn (request: ListActiveThreadsRequest, opts: Map): Map

GET /guilds/{guild_id}/threads/active - Every active thread in a guild the bot can see. Returns {threads, members}.

Example

::channels ::discord::channels

active ::channels/list-active-threads(::channels/ListActiveThreadsRequest({guild_id: "1000000000000000000"}), {token: ::hot::ctx/get("tenant-b.discord.bot.token")})
map(active.threads, %.name)

list-private-archived-threads

fn (request: ListArchivedThreadsRequest): Map
fn (request: ListArchivedThreadsRequest, opts: Map): Map

GET /channels/{channel_id}/threads/archived/private - Archived private threads. before is an ISO8601 timestamp. Returns {threads, members, has_more}. Needs READ_MESSAGE_HISTORY and MANAGE_THREADS.

Example

::channels ::discord::channels

archived ::channels/list-private-archived-threads(::channels/ListArchivedThreadsRequest({
  channel_id: "1100000000000000000",
  limit: 50
}))
map(archived.threads, %.name)

list-public-archived-threads

fn (request: ListArchivedThreadsRequest): Map
fn (request: ListArchivedThreadsRequest, opts: Map): Map

GET /channels/{channel_id}/threads/archived/public - Archived public threads, newest first. before is an ISO8601 timestamp. Returns {threads, members, has_more}. Needs READ_MESSAGE_HISTORY.

Example

::channels ::discord::channels

archived ::channels/list-public-archived-threads(::channels/ListArchivedThreadsRequest({
  channel_id: "1100000000000000000",
  before: "2026-11-01T00:00:00Z",
  limit: 50
}))
archived.has_more

list-thread-members

fn (request: ListThreadMembersRequest): Vec<Map>
fn (request: ListThreadMembersRequest, opts: Map): Vec<Map>

GET /channels/{channel_id}/thread-members - Thread members (up to limit, 1-100). Page with after (a user id) when with_member is true. Needs the GUILD_MEMBERS intent.

Example

::channels ::discord::channels

members ::channels/list-thread-members(::channels/ListThreadMembersRequest({
  channel_id: "1100000000000000000",
  with_member: true,
  limit: 100
}))
map(members, %.user_id)

modify-channel

fn (request: ModifyChannelRequest): Map
fn (request: ModifyChannelRequest, opts: Map): Map

PATCH /channels/{channel_id} - Update a guild channel or thread. Only the fields you set are sent. To null a nullable field on purpose (move a channel out of its category, drop a topic), list it in clear, e.g. clear: ["parent_id"]. Needs MANAGE_CHANNELS (MANAGE_THREADS for threads). Thread-only fields: archived, auto_archive_duration, locked, invitable, applied_tags.

Example

::channels ::discord::channels

::channels/modify-channel(::channels/ModifyChannelRequest({
  channel_id: "1100000000000000000",
  topic: "Release coordination",
  rate_limit_per_user: 10,
  reason: "Slow mode during launch"
}))

modify-guild-channel-positions

fn (request: ModifyGuildChannelPositionsRequest): Bool
fn (request: ModifyGuildChannelPositionsRequest, opts: Map): Bool

PATCH /guilds/{guild_id}/channels - Reorder channels. positions is [{id, position?, lock_permissions?, parent_id?}]. Needs MANAGE_CHANNELS.

Example

::channels ::discord::channels

::channels/modify-guild-channel-positions(::channels/ModifyGuildChannelPositionsRequest({
  guild_id: "1000000000000000000",
  positions: [
    {id: "1100000000000000000", position: 0},
    {id: "1100000000000000001", position: 1, parent_id: "1400000000000000000"}
  ],
  reason: "Reorder for launch"
}))

remove-thread-member

fn (request: RemoveThreadMemberRequest): Bool
fn (request: RemoveThreadMemberRequest, opts: Map): Bool

DELETE /channels/{channel_id}/thread-members/{user_id} - Remove a user from a thread. Needs MANAGE_THREADS, or to be the creator of a private thread.

Example

::channels ::discord::channels

::channels/remove-thread-member(::channels/RemoveThreadMemberRequest({
  channel_id: "1100000000000000000",
  user_id: "1300000000000000000"
}))

start-forum-thread

fn (request: StartForumThreadRequest): Map
fn (request: StartForumThreadRequest, opts: Map): Map

POST /channels/{channel_id}/threads - Create a post in a forum or media channel. message is the first message ({content?, embeds?, components?, allowed_mentions?, sticker_ids?, attachments?, flags?}); applied_tags are forum tag ids. files are uploaded with it.

Example

::channels ::discord::channels

post ::channels/start-forum-thread(::channels/StartForumThreadRequest({
  channel_id: "1500000000000000000",
  name: "Weekly sync notes",
  message: {content: "Agenda in the thread"}
}))

start-thread-from-message

fn (request: StartThreadFromMessageRequest): Map
fn (request: StartThreadFromMessageRequest, opts: Map): Map

POST /channels/{channel_id}/messages/{message_id}/threads - Start a thread on an existing message. auto_archive_duration is 60, 1440, 4320 or 10080 minutes.

Example

::channels ::discord::channels

thread ::channels/start-thread-from-message(::channels/StartThreadFromMessageRequest({
  channel_id: "1100000000000000000",
  message_id: "1200000000000000000",
  name: "Deploy discussion",
  auto_archive_duration: 1440
}))
thread.id

start-thread-without-message

fn (request: StartThreadWithoutMessageRequest): Map
fn (request: StartThreadWithoutMessageRequest, opts: Map): Map

POST /channels/{channel_id}/threads - Start a thread with no starter message. type 11 = public, 12 = private (the default is private, so set it).

Example

::channels ::discord::channels

thread ::channels/start-thread-without-message(::channels/StartThreadWithoutMessageRequest({
  channel_id: "1100000000000000000",
  name: "Launch checklist",
  type: 11,
  auto_archive_duration: 4320
}))
thread.id

trigger-typing-indicator

fn (request: TriggerTypingIndicatorRequest): Bool
fn (request: TriggerTypingIndicatorRequest, opts: Map): Bool

POST /channels/{channel_id}/typing - Show "typing..." for about 10 seconds or until the bot sends a message.

Example

::channels ::discord::channels

::channels/trigger-typing-indicator(::channels/TriggerTypingIndicatorRequest({channel_id: "1100000000000000000"}))

Types

AddThreadMemberRequest

AddThreadMemberRequest type {
    channel_id: Str,
    user_id: Str
}

CreateChannelInviteRequest

CreateChannelInviteRequest type {
    channel_id: Str,
    max_age: Int?,
    max_uses: Int?,
    temporary: Bool?,
    unique: Bool?,
    target_type: Int?,
    target_user_id: Str?,
    target_application_id: Str?,
    role_ids: Vec<Str>?,
    reason: Str?
}

CreateGuildChannelRequest

CreateGuildChannelRequest type {
    guild_id: Str,
    name: Str,
    type: Int?,
    topic: Str?,
    bitrate: Int?,
    user_limit: Int?,
    rate_limit_per_user: Int?,
    position: Int?,
    permission_overwrites: Vec<Map>?,
    parent_id: Str?,
    nsfw: Bool?,
    rtc_region: Str?,
    video_quality_mode: Int?,
    default_auto_archive_duration: Int?,
    default_reaction_emoji: Map?,
    available_tags: Vec<Map>?,
    default_sort_order: Int?,
    default_forum_layout: Int?,
    default_thread_rate_limit_per_user: Int?,
    flags: Int?,
    reason: Str?
}

DeleteChannelPermissionRequest

DeleteChannelPermissionRequest type {
    channel_id: Str,
    overwrite_id: Str,
    reason: Str?
}

DeleteChannelRequest

DeleteChannelRequest type {
    channel_id: Str,
    reason: Str?
}

EditChannelPermissionsRequest

EditChannelPermissionsRequest type {
    channel_id: Str,
    overwrite_id: Str,
    type: Int,
    allow: Str?,
    deny: Str?,
    reason: Str?
}

FollowAnnouncementChannelRequest

FollowAnnouncementChannelRequest type {
    channel_id: Str,
    webhook_channel_id: Str,
    reason: Str?
}

GetChannelInvitesRequest

GetChannelInvitesRequest type {
    channel_id: Str
}

GetChannelRequest

GetChannelRequest type {
    channel_id: Str
}

GetGuildChannelsRequest

GetGuildChannelsRequest type {
    guild_id: Str
}

GetThreadMemberRequest

GetThreadMemberRequest type {
    channel_id: Str,
    user_id: Str,
    with_member: Bool?
}

JoinThreadRequest

JoinThreadRequest type {
    channel_id: Str
}

LeaveThreadRequest

LeaveThreadRequest type {
    channel_id: Str
}

ListActiveThreadsRequest

ListActiveThreadsRequest type {
    guild_id: Str
}

ListArchivedThreadsRequest

ListArchivedThreadsRequest type {
    channel_id: Str,
    before: Str?,
    limit: Int?
}

ListThreadMembersRequest

ListThreadMembersRequest type {
    channel_id: Str,
    with_member: Bool?,
    after: Str?,
    limit: Int?
}

ModifyChannelRequest

ModifyChannelRequest type {
    channel_id: Str,
    name: Str?,
    type: Int?,
    position: Int?,
    topic: Str?,
    nsfw: Bool?,
    rate_limit_per_user: Int?,
    bitrate: Int?,
    user_limit: Int?,
    permission_overwrites: Vec<Map>?,
    parent_id: Str?,
    rtc_region: Str?,
    video_quality_mode: Int?,
    default_auto_archive_duration: Int?,
    flags: Int?,
    available_tags: Vec<Map>?,
    default_reaction_emoji: Map?,
    default_thread_rate_limit_per_user: Int?,
    default_sort_order: Int?,
    default_forum_layout: Int?,
    archived: Bool?,
    auto_archive_duration: Int?,
    locked: Bool?,
    invitable: Bool?,
    applied_tags: Vec<Str>?,
    reason: Str?,
    clear: Vec<Str>?
}

ModifyGuildChannelPositionsRequest

ModifyGuildChannelPositionsRequest type {
    guild_id: Str,
    positions: Vec<Map>,
    reason: Str?
}

RemoveThreadMemberRequest

RemoveThreadMemberRequest type {
    channel_id: Str,
    user_id: Str
}

StartForumThreadRequest

StartForumThreadRequest type {
    channel_id: Str,
    name: Str,
    message: Map,
    auto_archive_duration: Int?,
    rate_limit_per_user: Int?,
    applied_tags: Vec<Str>?,
    files: Vec<::discord::api/FileUpload>?,
    reason: Str?
}

StartThreadFromMessageRequest

StartThreadFromMessageRequest type {
    channel_id: Str,
    message_id: Str,
    name: Str,
    auto_archive_duration: Int?,
    rate_limit_per_user: Int?,
    reason: Str?
}

StartThreadWithoutMessageRequest

StartThreadWithoutMessageRequest type {
    channel_id: Str,
    name: Str,
    auto_archive_duration: Int?,
    type: Int?,
    invitable: Bool?,
    rate_limit_per_user: Int?,
    reason: Str?
}

TriggerTypingIndicatorRequest

TriggerTypingIndicatorRequest type {
    channel_id: Str
}