Integrations

discord_http.integrations module

class discord_http.integrations.Integration(*, state, data, guild) None

Bases: PartialIntegration

Represents a guild integration.

Parameters:
id

The ID of the integration.

Type:

int

name

The name of the integration.

Type:

str

guild

The guild associated with this integration.

Type:

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:

int | None

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:

ExpireBehaviour | None

expire_grace_period

The grace period before expiring subscribers. This is not applicable to bot integrations.

Type:

int | None

synced_at

The time the integration was last synced. This is not applicable to bot integrations.

Type:

datetime | None

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 | dict | None

The account associated with this integration, if available.

property application: IntegrationApplication | None

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

property user: User | None

The user associated with this integration, if available.

class discord_http.integrations.IntegrationAccount(*, state, data) None

Bases: object

Represents an account associated with an integration.

Parameters:
id

The ID of the account.

Type:

str | int

name

The name of the account.

Type:

str

class discord_http.integrations.IntegrationApplication(*, state, data) None

Bases: PartialBase

Represents a bot/OAuth2 application for integrations.

Parameters:
name

The name of the application.

Type:

str

description

The description of the application.

Type:

str

summary

The summary of the application.

Type:

str

is_monetized

Whether the application is monetized.

Type:

bool

is_verified

Whether the application is verified.

Type:

bool

is_discoverable

Whether the application is discoverable.

Type:

bool

property bot: User | None

The bot associated with this application, if available.

property icon: Asset | None

The icon of the application, if available.

class discord_http.integrations.PartialIntegration(*, state, id, guild_id, application_id=None) None

Bases: PartialBase

Represents a partial integration object.

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

Parameters:
guild_id

The guild associated with this integration.

Type:

int

application_id

The ID of the application associated with this integration.

Type:

int | None

async delete() None

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.

Return type:

None

property guild: PartialGuild | Guild

The guild associated with this integration.

Type:

PartialGuild | Guild