ClientCompoundInviteEndpoints

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

application_invite_create(channel, application, ...)

Creates an EMBEDDED_APPLICATION invite to the specified voice channel. The application must have must have embedded flag.

Deprecated and will be removed in 2024 February.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The target channel of the invite.

application

Application, int

The embedded application to open in the voice channel.

The application must have EMBEDDED_APPLICATION flag.

max_age

int

0

After how much time (in seconds) will the invite expire.

If given as 0(so by default) then the created invite will never expire.

max_uses

int

0

How much times can the invite be used.

If given as 0(so by default) then the created invite will have no use limit.

unique

bool

True

Whether the created invite should be unique.

temporary

bool

False

Whether the invite should give only temporary membership.

Returns

invite : Invite

Raises

TypeError

  • If channel was not given neither as Channel, neither as int.
  • If application was not given neither as Application nor as int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

invite_create(channel, ...)

Creates an invite at the given channel with the given parameters.

To create stream invite pass the target_type parameter as InviteTargetTypes.stream and use either the target_user or target_user_id to define the streamer.

To create an embedded application invite pass the target_type parameter as InviteTargetTypes.embedded_application and use either the target_application or target_application_id to define the application.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
channel

Channel, int

The channel of the created invite.

invite_template

None, Invite

None

Invite entity to use as a template.

**keyword_parameters

Keyword parameters

Additional keyword parameters to create the invite with.

max_age

int

After how much time (in seconds) will the invite expire. Defaults is never.

max_uses

int

How much times can the invite be used. Defaults to unlimited.

target_application

int, Application

Alternative for target_application_id.

target_application_id

int, Application

The invite's target application.

target_type

InviteTargetType, int

The invite's target type.

target_user

int, ClientUserBase

Alternative for target_user.

target_user_id

int, ClientUserBase

The target of the invite if applicable.

temporary

bool

Whether the invite should give only temporary membership.

unique

bool

Whether the created invite should be unique.

Returns

invite : Invite

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.

invite_create_preferred(, ...)

Creates an invite to the guild's preferred channel.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription

guild . Guild

The guild the invite will be created to.

**keyword_parameters

Keyword parameters

Additional keyword parameters to describe the created invite.

max_age

int

0

After how much time (in seconds) will the invite expire. Defaults is never.

max_uses

int

0

How much times can the invite be used. Defaults to unlimited.

unique

bool

True

Whether the created invite should be unique.

temporary

bool

False

Whether the invite should give only temporary membership.

Returns

invite : Invite

Raises

TypeError

  • if guild is not GuildĖ›

ValueError

If the guild has no channel to create invite to.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

invite_delete(invite, ...)

Deletes the given invite.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
invite

Invite

The invite to delete.

reason

None, str

None

Shows up at the respective guild's audit logs.

Raises

TypeError

If invite was not given neither Invite nor str.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

invite_edit_vanity(guild, vanity_code, ...)

Edits the given guild's vanity invite's code.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
guild

Guild

The guild, what's invite will be edited.

vanity_code

str

The new code of the guild's vanity invite.

reason

None, str

None

Shows up at the guild's audit logs.

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.

AssertionError

If vanity_code was not given as str.

invite_get(invite)

Requests a partial invite with the given code.

This method is a coroutine.

ParameterTypeDescription
invite

Invite, str

The invites code.

Returns

invite : Invite

Raises

TypeError

If invite was not given neither Invite nor str.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

AssertionError

If invite_code was not given as str.

invite_get_all_channel(channel)

Gets the invites of the given channel.

This method is a coroutine.

ParameterTypeDescription
channel

Channel, int

The channel, what's invites will be requested.

Returns

invites : list of Invite objects

Raises

TypeError

If channel was not given neither as Channel, neither as int.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

invite_get_all_guild(guild)

Gets the invites of the given guild.

This method is a coroutine.

ParameterTypeDescription
guild

Guild, int

The guild, what's invites will be requested.

Returns

invites : list of Invite objects

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.

invite_get_vanity(guild)

Returns the vanity invite of the given guild.

This method is a coroutine.

ParameterTypeDescription
guild

Guild, int

The guild, what's invite will be returned.

Returns

invite : None, Invite

The vanity invite of the guild, None if it has no vanity invite.

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.

stream_invite_create(guild, user, ...)

Creates an STREAM invite at the given guild for the specific user. The user must be streaming at the guild, when the invite is created.

Deprecated and will be removed in 2024 February.

This method is a coroutine.

ParameterTypeOptionalKeyword onlyDefaultDescription
guild

Guild

The guild where the user streams.

user

ClientUserBase, int

The streaming user.

max_age

int

0

After how much time (in seconds) will the invite expire. Defaults is never.

max_uses

int

0

How much times can the invite be used. Defaults to unlimited.

unique

bool

True

Whether the created invite should be unique.

temporary

bool

False

Whether the invite should give only temporary membership.

Returns

invite : Invite

Raises

TypeError

ValueError

  • If the user is not streaming at the guild.

ConnectionError

No internet connection.

DiscordException

If any exception was received from the Discord API.

vanity_invite_edit()

Deprecated and will be removed in 2023 February. Please use .invite_edit_vanity instead.