Invite

discord_http.invite module

class discord_http.invite.Invite(*, state, data)

Bases: PartialInvite

Represents an invite object.

Parameters:
code

The invite code.

Type:

str

uses

The number of times the invite has been used.

Type:

int

max_uses

The maximum number of times the invite can be used.

Type:

int

temporary

Whether the invite grants temporary membership.

Type:

bool

created_at

The time the invite was created.

Type:

datetime | None

expires_at

The time the invite expires, if applicable.

Type:

datetime | None

inviter

The user who created the invite, if applicable.

Type:

User | None

guild_id

The ID of the guild the invite is in, if applicable.

Type:

int | None

channel_id

The ID of the channel the invite is in, if applicable.

Type:

int | None

type

The type of the invite.

Type:

InviteType

is_vanity() bool

Whether the invite is a vanity invite.

Return type:

bool

class discord_http.invite.PartialInvite(*, state, code, channel_id=None, guild_id=None)

Bases: object

Represents a partial invite object.

Parameters:
code

The invite code.

Type:

str

channel_id

The ID of the channel the invite is in, if applicable.

Type:

int | None

guild_id

The ID of the guild the invite is in, if applicable.

Type:

int | None

guild

The guild associated with the invite, if applicable.

Type:

Guild | PartialGuild | None

BASE = 'https://discord.gg'
property channel: PartialChannel | None

The channel the invite is in.

async delete(*, reason=None) Invite

Deletes the invite.

Parameters:

reason (str) – The reason for deleting the invite

Return type:

Invite

Returns:

The invite object

async fetch() Invite

Fetches the invite details.

Return type:

Invite

Returns:

The invite object

property url: str

The URL of the invite.