ClientCompoundThreadEndpoints

Methods

__new__()

Compound components do not support instancing.

Sub-typing is supported, but the attributes are only proxied. Sub-types have no meaning by themselves.

Raises

RuntimeError

channel_thread_get_all_active(channel)

Requests all the active threads of the given channel.

ParameterTypeDescription
channel

Channel, int

The channel to request the thread of, or it's identifier.

Returns

thread_channels : list of Channel

Raises

TypeError

If channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

When using API v10 or later, this endpoint filters from .guild_thread_get_all_active method's return. Consider using that instead.

Active threads can also be extracted from Guild.threads.

channel_thread_get_all_archived_private(channel)

Requests all the archived private of the given channel.

ParameterTypeDescription
channel

Channel, int

The channel to request the thread of, or it's identifier.

Returns

thread_channels : list of Channel

Raises

TypeError

If channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_thread_get_all_archived_public(channel)

Requests all the archived public threads of the given channel.

ParameterTypeDescription
channel

Channel, int

The channel to request the thread of, or it's identifier.

Returns

thread_channels : list of Channel

Raises

TypeError

If channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_thread_get_all_self_archived(channel)

Requests all the archived private threads by the client.

ParameterTypeDescription
channel

Channel, int

The channel to request the thread of, or it's identifier.

Returns

thread_channels : list of Channel

Raises

TypeError

If channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

forum_thread_create(channel_forum, ...)

Creates and thread at the given channel with the given message fields. If there is nothing to send will return None for channel and None for message as well.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel_forum

Channel, int

The forum channel's identifier where the thread will be started.

channel_template

None, Channel

None

(Thread) channel entity to use as a template.

*positional_parameters

Positional parameters

Additional parameters to create the message with.

**keyword_parameters

Keyword parameters

Additional parameters to create the message with.

allowed_mentions

None, AllowedMentionProxy, str, UserBase, Role, list of (str, UserBase, Role)

Which user or role can the message ping (or everyone). Check parse_allowed_mentions for details.

applied_tag_ids

None, (list | tuple)<int | ForumTag>, int, ForumTag

The tags' identifier which have been applied to the thread.

applied_tags

None, (list | tuple)<int | ForumTag>, int, ForumTag

Alternative for applied_tag_ids.

attachments

None, object

Attachments to send.

auto_archive_after

int

The default duration (in seconds) for newly created threads to automatically archive the themselves.

components

None, Component, (tuple | list)<Component, (tuple | list)<Component>>

Components attached to the message.

content

None, str

The message's content if given.

embed

None, Embed

Alternative for embeds.

embeds

None, list<Embed>

The new embedded content of the message.

file

None, object

Alternative for attachments.

files

None, object

Alternative for attachments.

flags

int, ChannelFlag

The channel's flags. Due to name collision, message.flags is not directly supported.

invitable

bool

Whether non-moderators can invite other non-moderators to the threads.

name

str

The channel's name.

nonce

None, str

Used for optimistic message sending.

open_

bool

Whether the thread is open.

silent

bool

False

Whether the message should be delivered silently.

slowmode

int

The channel's slowmode.

sticker

None, Sticker

Alternative for sticker_ids.

sticker_ids

None, list<int>

Sticker(s) to send within the message.

stickers

None, list<int | Sticker>

Alternative for sticker_ids.

suppress_embeds

bool

False

Whether the message's embeds should be suppressed initially.

tts

bool

False

Whether the message is text-to-speech.

Returns

thread_channel : None, Channel

The created thread channel. None if there was nothing to send.

message : None, Message

Returns None if there is nothing to send.

Raises

TypeError

  • If a parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

See Also

.message_create: Sending a message to a text channel. .thread_create: Create thread in a text channel.

guild_thread_get_all_active(guild)

Gets all the active threads of the given guild.

This method is a coroutine.

ParameterTypeDescription
guild

Guild, int

The guild to get it's threads of.

If the guild is given as 0, will return an empty list.

Returns

threads : list of Channel

Raises

TypeError

If guild is neither Guild nor int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_create(message_or_channel, ...)

Creates a new thread derived from the given message or channel.

For private thread channels the guild needs to have level 2 boost level.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
message_or_channel

Channel, Message, int, tuple(int, int)

The channel or message to create thread from.

If given as a channel instance, will create a private thread, else a public one.

channel_template

None, Channel

None

Channel to use as a template.

**keyword_parameters

Keyword parameters

Additional keyword parameters either to define the template, or to overwrite specific fields' values.

applied_tag_ids

None, (list | tuple)<int | ForumTag>, int, ForumTag

The tags' identifier which have been applied to the thread.

applied_tags

None, (list | tuple)<int | ForumTag>, int, ForumTag

Alternative for applied_tag_ids.

auto_archive_after

int

The default duration (in seconds) for newly created threads to automatically archive the themselves.

channel_type

None, ChannelType, int

None

The type of the created (thread) channel.

flags

int, ChannelFlag

The channel's flags.

invitable

bool

Whether non-moderators can invite other non-moderators to the threads.

name

str

The channel's name.

open_

bool

Whether the thread channel is open.

slowmode

int

The channel's slowmode.

Returns

thread_channel : Channel

The created thread channel.

Raises

TypeError

If any parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_join(thread_channel)

Joins the client to the given thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to join to, or it's identifier.

Raises

TypeError

If thread_channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_leave(thread_channel)

Leaves the client to the given thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to join to, or it's identifier.

Raises

TypeError

If thread_channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_user_add(thread_channel, user)

Adds the user to the thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to add the user to, or it's identifier.

user

ClientUserBase, int

The user to add to the the thread.

Raises

TypeError

  • If thread_channel 's type is incorrect.
  • If user 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_user_delete(thread_channel, user)

Deletes the user to the thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to remove the user from, or it's identifier.

user

ClientUserBase, int

The user to remove from the thread.

Raises

TypeError

  • If thread_channel 's type is incorrect.
  • If user 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_user_get(thread_channel, user)

Gets a user's thread profile inside of a thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to get the user's thread profile of.

user

ClientUserBase, int

The user to get it's thread profile of.

Returns

user : ClientUserBase

The user, who's thread profile was requested.

Raises

TypeError

  • If thread_channel 's type is incorrect.
  • If user 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

thread_user_get_all(thread_channel)

Gets all the users of a thread channel.

This method is a coroutine.

ParameterTypeDescription
thread_channel

Channel, int

The channel to get it's users of.

Returns

users : list of ClientUserBase

The created users.

Raises

TypeError

If thread_channel 's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.