Package discord4j.core.object.entity
Class Integration
java.lang.Object
discord4j.core.object.entity.Integration
- All Implemented Interfaces:
DiscordObject
,Entity
A Discord integration.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the various integration expire behaviors. -
Constructor Summary
ConstructorDescriptionIntegration
(GatewayDiscordClient gateway, discord4j.discordjson.json.IntegrationData data, long guildId) Constructs anIntegration
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the integration account information.Gets the bot/OAuth2 application for discord integrations, if present.Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.IntegrationData
getData()
Gets the data of the integration.Gets the behavior of expiring subscribers, if present.Gets the grace period (in days) before expiring subscribers, if present.Gets the ID of the guild this integration is associated to.getId()
Gets the Snowflake that uniquely identifies this entity.getName()
Gets the integration name.Gets how many subscribers this integration has, if present.Requests to retrieve the role that this integration uses for "subscribers".getSubscriberRole
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the role that this integration uses for "subscribers", using the given retrieval strategy.Gets the id that this integration uses for "subscribers".Gets when this integration was last synced, if present.getType()
Gets the integration type (twitch, youtube, or discord).getUser()
Gets the user for this integration, if present.int
hashCode()
boolean
Gets whether the integration is enabled.boolean
Gets whether emoticons should be synced for this integration (twitch only currently).boolean
Gets whether integration has been revoked.boolean
Gets whether the integration is syncing.toString()
-
Constructor Details
-
Integration
public Integration(GatewayDiscordClient gateway, discord4j.discordjson.json.IntegrationData data, long guildId) Constructs anIntegration
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.guildId
- The ID of the guild this integration is associated to.
-
-
Method Details
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getId
Description copied from interface:Entity
Gets the Snowflake that uniquely identifies this entity. -
getGuildId
Gets the ID of the guild this integration is associated to.- Returns:
- The ID of the guild this integration is associated to.
-
getData
public discord4j.discordjson.json.IntegrationData getData()Gets the data of the integration.- Returns:
- The data of the integration.
-
getName
Gets the integration name.- Returns:
- The integration name.
-
getType
Gets the integration type (twitch, youtube, or discord).- Returns:
- The integration type (twitch, youtube, or discord).
-
isEnabled
public boolean isEnabled()Gets whether the integration is enabled.- Returns:
- Whether the integration is enabled.
-
isSyncing
public boolean isSyncing()Gets whether the integration is syncing.- Returns:
- Whether the integration is syncing.
-
getSubscriberRoleId
Gets the id that this integration uses for "subscribers".- Returns:
- The id that this integration uses for "subscribers".
-
getSubscriberRole
Requests to retrieve the role that this integration uses for "subscribers". -
getSubscriberRole
Requests to retrieve the role that this integration uses for "subscribers", using the given retrieval strategy. -
isEnableEmoticons
public boolean isEnableEmoticons()Gets whether emoticons should be synced for this integration (twitch only currently).- Returns:
- Whether emoticons should be synced for this integration (twitch only currently).
-
getExpireBehavior
Gets the behavior of expiring subscribers, if present.- Returns:
- The behavior of expiring subscribers, if present.
-
getExpireGracePeriod
Gets the grace period (in days) before expiring subscribers, if present.- Returns:
- The grace period (in days) before expiring subscribers, if present.
-
getUser
Gets the user for this integration, if present.- Returns:
- The user for this integration, if present.
-
getAccount
Gets the integration account information.- Returns:
- The integration account information.
-
getSyncedAt
Gets when this integration was last synced, if present.- Returns:
- When this integration was last synced, if present.
-
getSubscriberCount
Gets how many subscribers this integration has, if present.- Returns:
- How many subscribers this integration has, if present.
-
isRevoked
public boolean isRevoked()Gets whether integration has been revoked.- Returns:
- Whether integration has been revoked.
-
getApplication
Gets the bot/OAuth2 application for discord integrations, if present.- Returns:
- The bot/OAuth2 application for discord integrations, if present.
-
equals
-
hashCode
public int hashCode() -
toString
-