Integrations¶
This section documents everything related to Integrations - special entities integrated into Guilds.
Most common examples are bots and Twitch/YouTube integrations.
Discord Models¶
Integration¶
- class disnake.Integration[source]¶
- Represents a guild integration. - New in version 1.4. - account¶
- The account linked to this integration. - Type:
 
 - await delete(*, reason=None)[source]¶
- This function is a coroutine. - Deprecated since version 2.5: Can only be used on the application’s own integration and is therefore equivalent to leaving the guild. - Deletes the integration. - You must have - manage_guildpermission to use this.- Parameters:
- The reason the integration was deleted. Shows up on the audit log. - New in version 2.0. 
- Raises:
- Forbidden – You do not have permission to delete the integration. 
- HTTPException – Deleting the integration failed. 
 
 
 
IntegrationAccount¶
BotIntegration¶
- class disnake.BotIntegration[source]¶
- Represents a bot integration on Discord. - New in version 2.0. - account¶
- The integration account information. - Type:
 
 - application¶
- The application tied to this integration. - Type:
 
 - scopes¶
- The OAuth2 scopes the application has been authorized for. - New in version 2.6. 
 - property created_at[source]¶
- Returns the integration’s (not the associated application’s) creation time in UTC. - New in version 2.10. - Type:
 
 - await delete(*, reason=None)[source]¶
- This function is a coroutine. - Deprecated since version 2.5: Can only be used on the application’s own integration and is therefore equivalent to leaving the guild. - Deletes the integration. - You must have - manage_guildpermission to use this.- Parameters:
- The reason the integration was deleted. Shows up on the audit log. - New in version 2.0. 
- Raises:
- Forbidden – You do not have permission to delete the integration. 
- HTTPException – Deleting the integration failed. 
 
 
 
IntegrationApplication¶
- class disnake.IntegrationApplication[source]¶
- Represents an application for a bot integration. - New in version 2.0. - property summary[source]¶
- The application’s summary. Can be an empty string. - Deprecated since version 2.5: This field is deprecated by discord and is now always blank. Consider using - descriptioninstead.- Type:
 
 
StreamIntegration¶
- class disnake.StreamIntegration[source]¶
- Represents a stream integration for Twitch or YouTube. - New in version 2.0. - enable_emoticons¶
- Whether emoticons should be synced for this integration (currently twitch only). 
 - expire_behaviour¶
- The behaviour of expiring subscribers. Aliased to - expire_behavioras well.- Type:
 
 - account¶
- The integration account information. - Type:
 
 - synced_at¶
- An aware UTC datetime representing when the integration was last synced. - Type:
 
 - property expire_behavior[source]¶
- An alias for - expire_behaviour.- Type:
 
 - await edit(*, expire_behaviour=..., expire_grace_period=..., enable_emoticons=...)[source]¶
- This function is a coroutine. - Deprecated since version 2.5: No longer supported, bots cannot use this endpoint anymore. - Edits the integration. - You must have - manage_guildpermission to use this.- Changed in version 2.6: Raises - TypeErrorinstead of- InvalidArgument.- Parameters:
- expire_behaviour ( - ExpireBehaviour) – The behaviour when an integration subscription lapses. Aliased to- expire_behavioras well.
- expire_grace_period ( - int) – The period (in days) where the integration will ignore lapsed subscriptions.
- enable_emoticons ( - bool) – Where emoticons should be synced for this integration (currently twitch only).
 
- Raises:
- Forbidden – You do not have permission to edit the integration. 
- HTTPException – Editing the guild failed. 
- TypeError – - expire_behaviourdid not receive a- ExpireBehaviour.
 
 
 - await sync()[source]¶
- This function is a coroutine. - Deprecated since version 2.5: No longer supported, bots cannot use this endpoint anymore. - Syncs the integration. - You must have - manage_guildpermission to use this.- Raises:
- Forbidden – You do not have permission to sync the integration. 
- HTTPException – Syncing the integration failed. 
 
 
 - property created_at[source]¶
- Returns the integration’s (not the associated application’s) creation time in UTC. - New in version 2.10. - Type:
 
 - await delete(*, reason=None)[source]¶
- This function is a coroutine. - Deprecated since version 2.5: Can only be used on the application’s own integration and is therefore equivalent to leaving the guild. - Deletes the integration. - You must have - manage_guildpermission to use this.- Parameters:
- The reason the integration was deleted. Shows up on the audit log. - New in version 2.0. 
- Raises:
- Forbidden – You do not have permission to delete the integration. 
- HTTPException – Deleting the integration failed. 
 
 
 
PartialIntegration¶
Data Classes¶
RawIntegrationDeleteEvent¶
- class disnake.RawIntegrationDeleteEvent[source]¶
- Represents the event payload for an - on_raw_integration_delete()event.- New in version 2.0. 
Enumerations¶
ExpireBehaviour¶
- class disnake.ExpireBehaviour[source]¶
- Represents the behaviour the - Integrationshould perform when a user’s subscription has finished.- There is an alias for this called - ExpireBehavior.- New in version 1.4. - remove_role¶
- This will remove the - StreamIntegration.rolefrom the user when their subscription is finished.
 - kick¶
- This will kick the user when their subscription is finished.