ClientCompoundChannelEndpoints

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_create(guild, ...)

Creates a new channel at the given guild. If the channel is successfully created returns it.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
guild

Guild, int

The guild where the channel will be created.

channel_template

None, Channel

None

Channel entity to use as a template.

reason

None, str

None

Shows up at the guild 's audit logs.

**keyword_parameters

Keyword parameters

Additional keyword parameters to create the channel with.

bitrate

int

The bitrate (in bits) of the voice channel.

default_forum_layout

ForumLayout, int

The default layout used to display threads of the forum.

default_sort_order

SortOrder, int

The default thread ordering of the forum.

default_thread_auto_archive_after

int

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

default_thread_reaction_emoji

None, Emoji

The emoji to show in the add reaction button on a thread of the forum channel.

default_thread_slowmode

int

The default slowmode applied to the channel's threads.

channel_type

ChannelType, int

The type of the created channel.

flags

int, ChannelFlag

The channel's flags.

name

str

The channel's name.

nsfw

bool

Whether the channel is marked as non safe for work.

parent_id

None, int, Channel

The channel's parent's identifier.

permission_overwrites

None, list of PermissionOverwrite

The channel's permission overwrites.

position

int

The channel's position.

region

None, VoiceRegion, str

The channel's voice region.

slowmode

int

The channel's slowmode.

topic

None, str

The channel's topic.

users

iterable of (int, ClientUserBase)

The users in the channel.

video_quality_mode

VideoQualityMode

The video quality of the voice channel.

Returns

channel : Channel

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_delete(channel, ...)

Deletes the specified guild channel.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel to delete.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

TypeError

If the given channel is not Channel, int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

If a category channel is deleted, it's sub-channels will not be removed, instead they will move under the guild.

channel_edit(channel, ...)

Edits the given guild channel. Different channel types accept different fields, so make sure to not pass out of place parameters. Only the given fields will be modified of the channel.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel to edit.

channel_template

None, Channel

None

A channel to use as a template.

reason

None, str

None

Shows up at the respective guild's audit logs.

**keyword_parameters

Keyword parameters

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

applied_tag_ids

None, tuple of (int, ForumTag)

The tags' identifier which have been applied to the thread. Applicable for threads of a forum.

auto_archive_after

int

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

bitrate

int

The bitrate (in bits) of the voice channel.

default_forum_layout

ForumLayout, int

The default layout used to display threads of the forum.

default_sort_order

SortOrder, int

The default thread ordering of the forum.

default_thread_auto_archive_after

int

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

default_thread_reaction_emoji

None, Emoji

The emoji to show in the add reaction button on a thread of the forum channel.

default_thread_slowmode

int

The default slowmode applied to the channel's threads.

flags

int, ChannelFlag

The channel's flags.

name

str

The channel's name.

nsfw

bool

Whether the channel is marked as non safe for work.

open_

bool

Whether the thread channel is open.

parent_id

None, int, Channel

The channel's parent's identifier.

permission_overwrites

None, list of PermissionOverwrite

The channel's permission overwrites.

position

int

The channel's position.

region

None, VoiceRegion, str

The channel's voice region.

slowmode

int

The channel's slowmode.

topic

None, str

The channel's topic.

users

iterable of (int, ClientUserBase)

The users in the channel.

video_quality_mode

VideoQualityMode

The video quality of the voice channel.

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_edit_status(channel, status, ...)

Edits the channel with the given status. Channel should be a guild voice.

this function is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel to edit.

status

None, str

The channel's status.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

TypeError

  • If any parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_follow(source_channel, target_channel, ...)

Follows the source_channel with the target_channel. Returns the webhook, what will crosspost the published messages.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
source_channel

Channel, int

The channel what will be followed. Must be an announcements channel.

target_channel

Channel, int instance

The target channel where the webhook messages will be sent. Can be any guild text channel type.

reason

None, str

None

Shows up at the respective guild's audit logs.

Returns

webhook : Webhook

The webhook what will crosspost the published messages. This webhook has no .token set.

Raises

TypeError

  • If the source_channel was not given neither as Channel nor int.
  • If the target_channel was not given neither as Channel nor int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_group_create(...)

Creates a group channel with the given users.

This method is a coroutine.

ParameterTypeOptionalDescription
*users

ClientUserBase, int

The users to create the channel with.

Returns

channel : Channel

The created group channel.

Raises

TypeError

If users contain not only User, Client, int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

This endpoint does not support bot accounts.

channel_group_edit(channel, ...)

Edits the given group channel. Only the provided parameters will be edited.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel to edit.

channel_template

None, Channel

None

A channel to use as a template.

**keyword_parameters

Keyword parameters

Additional keyword parameters to define which fields should be modified.

icon

None, bytes-like

The new icon of the channel. By passing None your can remove the actual one.

name

None, str

The new name of the channel. By passing None or an empty string you can remove the actual one.

Raises

TypeError

  • If a parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

No request is done if no optional parameter is provided.

channel_group_leave(channel)

Leaves the client from the specified group channel.

This method is a coroutine.

ParameterTypeDescription
channel

Channel, int

The channel to leave from.

Raises

TypeError

If channel was not given neither as Channel nor int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_group_user_add(channel, ...)

Adds the users to the given group channel.

This method is a coroutine.

ParameterTypeOptionalDescription
channel

Channel, int

The channel to add the users to.

*users

ClientUserBase, int

The users to add to the channel.

Raises

TypeError

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_group_user_delete(channel, ...)

Removes the users from the given group channel.

This method is a coroutine.

ParameterTypeOptionalDescription
channel

Channel, int

The channel from where the users will be removed.

*users

ClientUserBase, int

The users to remove from the channel.

Raises

TypeError

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_move(channel, visual_position, ...)

Moves a guild channel to the given visual position under it's parent, or guild. If the algorithm can not place the channel exactly on that location, it will place it as close, as it can. If there is nothing to move, then the request is skipped.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel

The channel to be moved.

visual_position

int

The visual position where the channel should go.

parent

None, Channel

If not set, then the channel will keep it's current parent. If the parameter is set Guild or to None, then the channel will be moved under the guild itself, Or if passed as Channel, then the channel will be moved under it.

lock_permissions

bool

False

If you want to sync the permissions with the new category set it to True. Defaults to False.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

ValueError

  • If the channel would be between guilds.
  • If parent channel would be moved under an other category.

TypeError

  • If channel was isn ot movable.
  • If parent was not given as None, Channel.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

This method also fixes the messy channel positions of Discord to an intuitive one.

channel_private_create(user)

Creates a private channel with the given user. If there is an already cached private channel with the user, returns that.

This method is a coroutine.

ParameterTypeDescription
user

ClientUserBase, int

The user to create the private with.

Returns

channel : Channel

The created private channel.

Raises

TypeError

If user was not given neither as ClientUserBase nor int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

channel_private_get_all()

Request the client's private + group channels and returns them in a list. At the case of bot accounts the request returns an empty list, so we skip it.

This method is a coroutine.

Returns

channels : list of (Channel, Channel) objects

Raises

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

forum_tag_create(forum_channel, ...)

Creates a new forum tag in the channel.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
forum_channel

Channel, int

The channel to create the tag in.

forum_tag

ForumTag, None

None

A forum tag which can be used as a template for the newly created tag.

reason

None, str

None

Shows up at the respective guild's audit logs.

**keyword_parameters

Keyword parameters

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

emoji

None, Emoji

The tag's emoji.

moderated

bool

Whether this tag can only be added or removed by a user with manage_threads permission.

name

str

The tag's name.

Returns

forum_tag : None, ForumTag

The created forum tag.

Raises

TypeError

If a parameter's type is not acceptable.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

Notes

A forum channel can have up to 25 tags.

See Also

forum_tag_delete(forum_channel, forum_tag, ...)

Deletes the given forum tag.

ParameterTypeOptionalKeyword onlyDefaultDescription
forum_channel

Channel, int

The channel to edit the tag in.

forum_tag

ForumTag, int

The forum tag to delete.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

TypeError

If a parameter's type is not acceptable.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

See Also

forum_tag_edit(forum_channel, forum_tag, ...)

Edits the given forum tag.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
forum_channel

Channel, int

The channel to edit the tag in.

forum_tag

ForumTag, int

The forum tag to edit.

template_forum_tag

ForumTag, None

None

A forum tag which can be used as a template for edition.

reason

None, str

None

Shows up at the respective guild's audit logs.

**keyword_parameters

Keyword parameters

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

emoji

None, Emoji

The tag's emoji.

moderated

bool

Whether this tag can only be added or removed by a user with manage_threads permission.

name

str

The tag's name.

Raises

TypeError

If a parameter's type is not acceptable.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

See Also

guild_channel_get_all(guild)

Requests the given guild's channels and if there any de-sync between the wrapper and Discord, applies the changes.

This method is a coroutine.

ParameterTypeDescription
guild

Guild, int

The guild, what's channels will be requested.

Returns

channels : list of Channel

Raises

TypeError

If guild was not given neither as Guild, nor as int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

permission_overwrite_create(channel, ...)

Creates a permission overwrite at the given channel.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel to what the permission overwrite will be added.

permission_overwrite_template

None, PermissionOverwrite

None

Permission overwrite to be used as a template for creating the new one.

reason

None, str

None

Shows up at the respective guild's audit logs.

**keyword_parameters

Keyword parameters

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

allow

None, Permission, int

The permission overwrite's allowed permission's value.

deny

None, Permission, int

The permission overwrite's denied permission's value.

target

int, Role, ClientUserBase

The permission overwrite's target. Shortcut for defining target_id and target_type with 1 parameter.

target_id

int

The permission overwrite's target's identifier.

target_type

None, PermissionOverwriteTargetType

The permission overwrite's target's type. Required if target_id is given as a snowflake.

Returns

permission_overwrite : PermissionOverwrite

A permission overwrite, what estimatedly is same as the one what Discord will create.

Raises

TypeError

  • If a parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

permission_overwrite_delete(channel, permission_overwrite, ...)

Deletes the given permission overwrite.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

˙˙Channel

The channel where the permission overwrite is.

permission_overwrite

PermissionOverwrite, int

The permission overwrite to delete.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

TypeError

  • If a parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

permission_overwrite_edit(channel, permission_overwrite, ...)

Edits the given permission overwrite.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

˙˙Channel, int

The channel where the permission overwrite is.

permission_overwrite

PermissionOverwrite

The permission overwrite to edit.

reason

None, str

None

Shows up at the respective guild's audit logs.

**keyword_parameters

Keyword parameters

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

allow

None, Permission, int

The permission overwrite's allowed permission's value.

deny

None, Permission, int

The permission overwrite's denied permission's value.

Raises

TypeError

  • If a parameter's type is incorrect.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.