Skip to main content
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.
int | str
required
The ID of the channel to retrieve.
Returns: A dict representing the 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.
int | str
required
The ID of the channel to modify.
str
The new channel name. Must be between 1 and 100 characters.
str
The new channel topic. Maximum 1024 characters. Pass an empty string "" to clear it.
bool
Mark or unmark the channel as age-restricted.
int
Slowmode delay in seconds (0–21600). Set to 0 to disable slowmode.
int
The channel’s position in the sidebar, zero-indexed.
Returns: The updated Channel object as a dict.
Editing a channel requires the Manage Channels permission in the target guild. Attempting to edit without sufficient permissions raises a 403 Forbidden error.

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.
int | str
required
The ID of the channel to delete.
Returns: None on success.
Deleting a guild channel is permanent and cannot be undone. All message history in that channel is lost. Use this method with care.

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.
int | str
required
The parent channel that contains the source message.
int | str
required
The message to attach the thread to. The message becomes the thread’s “starter message”.
str
required
The display name of the thread. Between 1 and 100 characters.
int
Minutes of inactivity before the thread auto-archives. See the valid durations below. Defaults to 1440.
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.
int | str
required
The parent channel in which to create the thread.
str
required
The display name of the thread.
int
The thread type. See the thread kinds table below. Defaults to 11 (Public Thread).
int
Minutes of inactivity before auto-archiving. Defaults to 1440.
bool
(Private threads only) Whether non-moderators can invite other members to the thread.
Returns: The newly created Channel object (thread) as a dict.

Thread Kinds

The kind parameter controls what type of thread is created.
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.

Auto-Archive Durations

The auto_archive parameter accepts the following values (in minutes):
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.
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.