Integrations

discord_http.integrations module

class discord_http.integrations.Integration(*, state: DiscordAPI, data: dict, guild: PartialGuild | Guild)[source]

Bases: PartialIntegration

Represents a guild integration.

id

The ID of the integration.

Type:

int

name

The name of the integration.

Type:

str

guild

The guild associated with this integration.

Type:

class:PartialGuild | Guild

type

The type of the integration. (e.g. “twitch”, “youtube” or “discord”)

Type:

str

enabled

Whether the integration is enabled.

Type:

bool

syncing

Whether the integration is syncing.

This is not applicable to bot integrations.

Type:

bool

role_id

ID of the role that the integration uses for “subscribers”.

TThis is not applicable to bot integrations.

Type:

Optional[int]

enable_emoticons

Whether emoticons should be synced for this integration (twitch only currently)

This is not applicable to bot integrations.

Type:

bool

expire_behavior

The behavior of expiring subscribers.

This is not applicable to bot integrations.

Type:

Optional[ExpireBehaviour]

expire_grace_period

The grace period before expiring subscribers.

This is not applicable to bot integrations.

Type:

Optional[int]

synced_at

The time the integration was last synced.

This is not applicable to bot integrations.

Type:

Optional[datetime]

subscriber_count

The number of subscribers for the integration.

This is not applicable to bot integrations.

Type:

int

revoked

Whether the integration has been revoked.

Type:

bool

scopes

The scopes of the application has been granted.

Type:

List[str]

property account: IntegrationAccount | None

The account associated with this integration, if available.

Type:

Optional[IntegrationAccount]

property application: IntegrationApplication | None

The bot/OAuth2 application for discord integrations, if available.

Type:

Optional[IntegrationApplication]

property user: User | None

The user associated with this integration, if available.

Type:

Optional[User]

class discord_http.integrations.IntegrationAccount(*, state: DiscordAPI, id: int, name: str)[source]

Bases: PartialBase

Represents an integration’s account.

id

The ID of the account.

Type:

int

name

The name of the account.

Type:

str

class discord_http.integrations.IntegrationApplication(*, state: DiscordAPI, data: dict)[source]

Bases: PartialBase

Represents a bot/OAuth2 application for integrations

id

The ID of the application.

Type:

int

name

The name of the application.

Type:

str

description

The description of the application.

Type:

str

property bot: User | None

The bot associated with this application, if available.

Type:

Optional[User]

property icon: Asset | None

The icon of the application, if available.

Type:

Optional[Asset]

class discord_http.integrations.PartialIntegration(*, state: DiscordAPI, id: int, guild_id: int, application_id: int | None = None)[source]

Bases: PartialBase

Represents a partial integration object.

This is mosly used to get the ids of objects if not in cache.

id

The ID of the integration.

Type:

int

guild_id

The guild associated with this integration.

Type:

int

application_id

The ID of the application associated with this integration.

Type:

Optional[int]

async delete() None[source]

Delete this integration for the guild.

This deletes any associated webhooks and kicks the associated bot if there is one.

This requires the MANAGE_GUILD permission.

property guild: PartialGuild | Guild

The guild associated with this integration.

Type:

PartialGuild | Guild