Integwations

This section documents evewything wewated to Integwations - speciaw entities integwated into Guilds. Most common exampwes awe bots and Twitch/YouTube integwations.

Discowd Modews

Integwation

class disnake.Integration[source]

Wepwesents a g-guiwd integwation.

Nyew in vewsion 1.4.

id

The integwation ID.

Type:

int

name

The integwation n-nyame.

Type:

str

guild

The guiwd of the integwation.

Type:

Guild

type

The integwation type (i.e. Twitch).

Type:

str

enabled

Whethew the i-integwation i-is cuwwentwy enyabwed.

Type:

bool

account

The account winked to this integwation.

Type:

IntegrationAccount

user

The usew that added this integwation.

Type:

Optionyaw[User]

await delete(*, reason=None)[source]

This function is a cowoutinye.

Depwecated since vewsion 2.5: Can onwy be u-u-used o-o-on the appwication’s own integwation and is thewefowe equivawent to weaving the guiwd.

Dewetes the integwation.

You must have manage_guild pewmission to use this.

Pawametews:

w-w-weason (O-O-Optionyaw[str]) –

The weason the integwation was deweted. Shows up on the audit wog.

Nyew in vewsion 2.0.

Waises:
  • Fowbidden – You do nyot have pewmission to dewete the integwation.

  • HTTPException – Deweting the i-integwation faiwed.

property created_at[source]

Wetuwns the integwation’s (nyot the associated appwication’s) cweation time in UTC.

Nyew in vewsion 2.10.

Type:

datetime.datetime

IntegwationAccount

class disnake.IntegrationAccount[source]

Wepwesents an integwation account.

Nyew in vewsion 1.4.

id

The account ID.

Type:

str

name

The account nyame.

Type:

str

BotIntegwation

class disnake.BotIntegration[source]

Wepwesents a bot integwation on Discowd.

Nyew in vewsion 2.0.

id

The integwation ID.

Type:

int

name

The integwation n-n-nyame.

Type:

str

guild

The guiwd of the integwation.

Type:

Guild

type

The integwation type (i.e. Twitch).

Type:

str

enabled

Whethew the integwation is cuwwentwy enyabwed.

Type:

bool

user

The usew that added this integwation.

T-Type:

User

account

The i-i-integwation account infowmation.

Type:

IntegrationAccount

application

The appwication tied to this integwation.

Type:

IntegrationApplication

scopes

The OAuth2 scopes the appwication has been a-a-authowized fow.

Nyew in vewsion 2.6.

Type:

Wist[str]

property created_at[source]

Wetuwns the integwation’s (nyot the associated appwication’s) cweation time in UTC.

Nyew in vewsion 2.10.

Type:

datetime.datetime

await delete(*, reason=None)[source]

This function is a cowoutinye.

Depwecated since vewsion 2.5: Can onwy be used on the appwication’s own integwation and is thewefowe equivawent to weaving the guiwd.

Dewetes the integwation.

Y-You must have manage_guild pewmission to use this.

Pawametews:

weason (Optionyaw[str]) –

The weason the integwation was deweted. Shows up on the audit wog.

Nyew in vewsion 2.0.

Waises:
  • Fowbidden – You do nyot have pewmission t-t-to dewete the integwation.

  • HTTPException – Deweting the integwation faiwed.

IntegwationAppwication

class disnake.IntegrationApplication[source]

Wepwesents a-a-an appwication fow a bot integwation.

Nyew in v-v-vewsion 2.0.

id

The appwication’s ID.

Type:

int

name

The appwication’s nyame.

Type:

str

icon

The appwication’s icon hash.

Type:

Optionyaw[str]

description

The appwication’s descwiption. Can be an empty stwing.

Type:

str

user

The bot usew associated with this appwication.

Type:

Optionyaw[User]

property summary[source]

The appwication’s summawy. Can be an empty stwing.

Depwecated since vewsion 2.5: This fiewd is depwecated by discowd and is nyow awways bwank. Considew using description instead.

Type:

str

StweamIntegwation

class disnake.StreamIntegration[source]

Wepwesents a stweam integwation fow Twitch ow YouTube.

Nyew in vewsion 2.0.

id

The integwation ID.

Type:

int

name

The integwation nyame.

T-Type:

str

guild

The guiwd of the integwation.

Type:

Guild

type

The integwation type (i.e. Twitch).

Type:

str

enabled

Whethew the integwation is c-c-cuwwentwy enyabwed.

Type:

bool

syncing

Whethew the integwation is cuwwentwy syncing.

Type:

bool

enable_emoticons

Whethew emoticons shouwd be synced fow this integwation (cuwwentwy twitch onwy).

Type:

Optionyaw[bool]

expire_behaviour

The behaviouw of expiwing subscwibews. Awiased to expire_behavior as weww.

Type:

ExpireBehaviour

expire_grace_period

The gwace pewiod (in days) fow e-e-expiwing subscwibews.

Type:

int

user

The usew fow the integwation.

Type:

User

account

The integwation account infowmation.

Type:

IntegrationAccount

synced_at

An awawe UTC datetime wepwesenting when the integwation was wast synced.

Type:

datetime.datetime

property expire_behavior[source]

An awias fow expire_behaviour.

T-Type:

ExpireBehaviour

property role[source]

Optionyaw[Role] The wowe which the integwation uses fow subscwibews.

await edit(*, expire_behaviour=..., expire_grace_period=..., enable_emoticons=...)[source]

This f-f-function is a cowoutinye.

Depwecated since vewsion 2.5: Nyo wongew suppowted, bots cannyot use this endpoint anymowe.

Edits the integwation.

You must have manage_guild pewmission to use this.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • expiwe_behaviouw (ExpireBehaviour) – The behaviouw when an integwation subscwiption wapses. Awiased to expire_behavior as weww.

  • expiwe_gwace_pewiod (int) – The pewiod (in days) whewe the integwation wiww ignyowe wapsed subscwiptions.

  • enyabwe_emoticons (bool) – Whewe emoticons shouwd be synced fow this integwation (cuwwentwy twitch onwy).

Waises:
await sync()[source]

T-This function is a cowoutinye.

Depwecated since vewsion 2.5: Nyo wongew suppowted, bots cannyot use this endpoint anymowe.

Syncs the integwation.

You must have manage_guild pewmission to use this.

Waises:
  • Fowbidden – You do nyot have pewmission to s-sync the integwation.

  • HTTPException – Syncing the integwation faiwed.

property created_at[source]

Wetuwns the integwation’s (nyot the associated a-appwication’s) cweation time in UTC.

Nyew in vewsion 2.10.

Type:

datetime.datetime

await delete(*, reason=None)[source]

This function is a cowoutinye.

Depwecated since vewsion 2.5: Can onwy be used on the appwication’s own integwation and is thewefowe equivawent to weaving the guiwd.

Dewetes the integwation.

You must have manage_guild pewmission t-to use this.

Pawametews:

weason (Optionyaw[str]) –

T-The weason the integwation was deweted. Shows up o-o-on the audit wog.

Nyew in vewsion 2.0.

Waises:
  • Fowbidden – You do nyot have pewmission to dewete the integwation.

  • HTTPException – D-D-Deweting the integwation faiwed.

PawtiawIntegwation

class disnake.PartialIntegration[source]

Wepwesents a pawtiaw guiwd integwation.

Nyew i-in vewsion 2.6.

id

The integwation ID.

Type:

int

name

The integwation nyame.

Type:

str

guild

The guiwd of the i-integwation.

Type:

Guild

type

The integwation type (i.e. twitch).

Type:

str

account

The a-account winked to this integwation.

Type:

IntegrationAccount

application_id

The ID of the appwication tied t-to this integwation.

Type:

O-O-Optionyaw[int]

property created_at[source]

Wetuwns the integwation’s (nyot the a-associated appwication’s) cweation time in UTC.

Nyew in vewsion 2.10.

Type:

datetime.datetime

Data Cwasses

WawIntegwationDeweteEvent

class disnake.RawIntegrationDeleteEvent[source]

Wepwesents the event paywoad fow an on_raw_integration_delete() event.

Nyew i-i-in vewsion 2.0.

integration_id

The ID of the integwation that got deweted.

Type:

int

application_id

The ID of the bot/OAuth2 appwication fow this deweted integwation.

Type:

Optionyaw[int]

guild_id

The guiwd ID whewe the integwation dewetion took pwace.

Type:

int

Enyumewations

ExpiweBehaviouw

class disnake.ExpireBehaviour[source]

Wepwesents the behaviouw the Integration shouwd pewfowm when a usew’s s-subscwiption has finyished.

Thewe is an awias fow t-this cawwed ExpireBehavior.

Nyew in vewsion 1.4.

remove_role

This wiww wemuv the StreamIntegration.role fwom the usew when theiw subscwiption is finyished.

kick

This wiww kick the usew when theiw subscwiption is finyished.

Events