> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guilt.icu/llms.txt
> Use this file to discover all available pages before exploring further.

# Channel and Thread HTTP Methods for the alterself REST API

> Fetch, edit, delete channels and create threads using alterself's bot.http channel methods. Covers text channels, voice channels, and threads.

Channel and thread management in alterself is exposed through `bot.http`, the same rate-limit-aware, header-spoofed HTTP client used for every other REST operation. All methods are **async** and must be awaited. Whether you're renaming a text channel, creating a new thread, or deleting a channel entirely, the client takes care of bucket management and retries so your code stays clean.

***

## fetch\_channel

Retrieve the full channel object for any channel ID you have access to. This works for text channels, voice channels, DM channels, and thread channels alike.

```python theme={null}
ch = await bot.http.fetch_channel(channel_id)
```

<ParamField path="channel_id" type="int | str" required>
  The ID of the channel to retrieve.
</ParamField>

**Returns:** A `dict` representing the [Channel object](https://discord.com/developers/docs/resources/channel#channel-object). The `type` field tells you what kind of channel it is.

***

## edit\_channel

Modify a channel's settings. You can update any combination of the supported fields in a single call.

```python theme={null}
ch = await bot.http.edit_channel(channel_id, name="new-name", topic="new topic")
```

<ParamField path="channel_id" type="int | str" required>
  The ID of the channel to modify.
</ParamField>

<ParamField path="name" type="str">
  The new channel name. Must be between 1 and 100 characters.
</ParamField>

<ParamField path="topic" type="str">
  The new channel topic. Maximum 1024 characters. Pass an empty string `""` to clear it.
</ParamField>

<ParamField path="nsfw" type="bool">
  Mark or unmark the channel as age-restricted.
</ParamField>

<ParamField path="rate_limit_per_user" type="int">
  Slowmode delay in seconds (0–21600). Set to `0` to disable slowmode.
</ParamField>

<ParamField path="position" type="int">
  The channel's position in the sidebar, zero-indexed.
</ParamField>

**Returns:** The updated Channel object as a `dict`.

<Warning>
  Editing a channel requires the **Manage Channels** permission in the target guild. Attempting to edit without sufficient permissions raises a `403 Forbidden` error.
</Warning>

***

## delete\_channel

Permanently delete a channel. For guild channels this is irreversible; for DM channels, it closes the conversation on your end but does not affect the other participant.

```python theme={null}
await bot.http.delete_channel(channel_id)
```

<ParamField path="channel_id" type="int | str" required>
  The ID of the channel to delete.
</ParamField>

**Returns:** `None` on success.

<Warning>
  Deleting a guild channel is **permanent and cannot be undone**. All message history in that channel is lost. Use this method with care.
</Warning>

***

## Threads

Threads are lightweight sub-channels attached to either an existing message or directly to a parent channel. alterself provides two creation methods depending on your use case.

### create\_thread\_from\_message

Create a public thread anchored to a specific message. The thread inherits the parent channel's permissions.

```python theme={null}
thread = await bot.http.create_thread_from_message(
    channel_id, message_id, "Thread name", auto_archive=1440
)
```

<ParamField path="channel_id" type="int | str" required>
  The parent channel that contains the source message.
</ParamField>

<ParamField path="message_id" type="int | str" required>
  The message to attach the thread to. The message becomes the thread's "starter message".
</ParamField>

<ParamField path="name" type="str" required>
  The display name of the thread. Between 1 and 100 characters.
</ParamField>

<ParamField path="auto_archive" type="int">
  Minutes of inactivity before the thread auto-archives. See the [valid durations](#auto-archive-durations) below. Defaults to `1440`.
</ParamField>

**Returns:** The newly created Channel object (thread) as a `dict`.

***

### create\_thread

Create a standalone thread not attached to any existing message. Useful for starting fresh discussions without cluttering the parent channel's message history.

```python theme={null}
thread = await bot.http.create_thread(
    channel_id, "New thread",
    kind=11,             # PUBLIC_THREAD
    auto_archive=10080,  # 7 days
)
```

<ParamField path="channel_id" type="int | str" required>
  The parent channel in which to create the thread.
</ParamField>

<ParamField path="name" type="str" required>
  The display name of the thread.
</ParamField>

<ParamField path="kind" type="int">
  The thread type. See the [thread kinds table](#thread-kinds) below. Defaults to `11` (Public Thread).
</ParamField>

<ParamField path="auto_archive" type="int">
  Minutes of inactivity before auto-archiving. Defaults to `1440`.
</ParamField>

<ParamField path="invitable" type="bool">
  *(Private threads only)* Whether non-moderators can invite other members to the thread.
</ParamField>

**Returns:** The newly created Channel object (thread) as a `dict`.

***

### Thread Kinds

The `kind` parameter controls what type of thread is created.

| Value | Name | Description |
| - | - | - |
| `10` | News Thread | A thread inside a Guild Announcement channel. Supports crossposting. |
| `11` | Public Thread | A publicly visible thread. Any member of the parent channel can join. |
| `12` | Private Thread | An invite-only thread. Only invited members and moderators can see it. |

<Note>
  News Threads (`10`) can only be created inside channels of type `5` (Guild Announcement). Attempting to create one in a standard text channel raises a `400 Bad Request`.
</Note>

***

### Auto-Archive Durations

The `auto_archive` parameter accepts the following values (in minutes):

| Value | Duration |
| - | - |
| `60` | 1 hour |
| `1440` | 24 hours |
| `4320` | 3 days |
| `10080` | 7 days |

<Note>
  The 3-day (`4320`) and 7-day (`10080`) durations are only available on guilds with the **SEVEN\_DAY\_THREAD\_ARCHIVE** or **THREE\_DAY\_THREAD\_ARCHIVE** feature flags, respectively. Most community servers and Nitro-boosted servers qualify automatically.
</Note>

<Tip>
  To keep a busy thread alive indefinitely, send a message in it periodically to reset the inactivity timer, or set `auto_archive=10080` paired with regular activity.
</Tip>
