Invite

discord_http.invite module

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

Bases: PartialInvite

Represents an invite object.

Parameters:
uses: int

The number of times the invite has been used.

max_uses: int

The maximum number of times the invite can be used.

temporary: bool

Whether the invite grants temporary membership.

created_at: datetime | None

The time the invite was created.

expires_at: datetime | None

The time the invite expires, if applicable.

inviter: User | None

The user who created the invite, if applicable.

guild_id: int | None

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

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

The channel the invite is in.

code

The invite code.

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

guild: Guild | PartialGuild | None

The guild associated with the invite, if applicable.

property url: str

The URL of the invite.

approximate_presence_count: int | None

The approximate number of online members, if applicable.

approximate_member_count: int | None

The approximate number of total members, if applicable.

roles: list[Role]

The roles a user gets when joining via this invite.

flags: GuildInviteFlags

The flags associated with the invite.

target_type: InviteTargetType | None

The target type of the invite, if applicable.

target_user: User | None

The user of the invite whose stream to display for this invite.

channel_id: int | None

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

property type: InviteType

The type of the invite.

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:
BASE: str = 'https://discord.gg'
code

The invite code.

channel_id: int | None

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

guild_id: int | None

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

guild: Guild | PartialGuild | None

The guild associated with the invite, if applicable.

property channel: PartialChannel | None

The channel the invite is in.

async fetch() Invite

Fetches the invite details.

Return type:

Invite

Returns:

The invite object

async delete(*, reason=None) Invite

Deletes the invite.

Parameters:

reason (str) – The reason for deleting the invite

Return type:

Invite

Returns:

The invite object

property url: str

The URL of the invite.