Package discord4j.core.object.entity
Class Integration
- java.lang.Object
-
- discord4j.core.object.entity.Integration
-
- All Implemented Interfaces:
DiscordObject,Entity
public class Integration extends Object implements Entity
A Discord integration.- See Also:
- Integration Resource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntegration.ExpireBehaviorRepresents the various integration expire behaviors.
-
Constructor Summary
Constructors Constructor Description Integration(GatewayDiscordClient gateway, discord4j.discordjson.json.IntegrationData data, long guildId)Constructs anIntegrationwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)IntegrationAccountgetAccount()Gets the integration account information.Optional<IntegrationApplication>getApplication()Gets the bot/OAuth2 application for discord integrations, if present.GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.discord4j.discordjson.json.IntegrationDatagetData()Gets the data of the integration.Optional<Integration.ExpireBehavior>getExpireBehavior()Gets the behavior of expiring subscribers, if present.Optional<Integer>getExpireGracePeriod()Gets the grace period (in days) before expiring subscribers, if present.SnowflakegetGuildId()Gets the ID of the guild this integration is associated to.SnowflakegetId()Gets the Snowflake that uniquely identifies this entity.StringgetName()Gets the integration name.Optional<Integer>getSubscriberCount()Gets how many subscribers this integration has, if present.Mono<Role>getSubscriberRole()Requests to retrieve the role that this integration uses for "subscribers".Mono<Role>getSubscriberRole(EntityRetrievalStrategy retrievalStrategy)Requests to retrieve the role that this integration uses for "subscribers", using the given retrieval strategy.Optional<Snowflake>getSubscriberRoleId()Gets the id that this integration uses for "subscribers".Optional<Instant>getSyncedAt()Gets when this integration was last synced, if present.StringgetType()Gets the integration type (twitch, youtube, or discord).Optional<User>getUser()Gets the user for this integration, if present.inthashCode()booleanisEnabled()Gets whether the integration is enabled.booleanisEnableEmoticons()Gets whether emoticons should be synced for this integration (twitch only currently).booleanisRevoked()Gets whether integration has been revoked.booleanisSyncing()Gets whether the integration is syncing.StringtoString()
-
-
-
Constructor Detail
-
Integration
public Integration(GatewayDiscordClient gateway, discord4j.discordjson.json.IntegrationData data, long guildId)
Constructs anIntegrationwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated 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 Detail
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
getId
public Snowflake getId()
Description copied from interface:EntityGets the Snowflake that uniquely identifies this entity.
-
getGuildId
public Snowflake 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
public String getName()
Gets the integration name.- Returns:
- The integration name.
-
getType
public String 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
public Optional<Snowflake> getSubscriberRoleId()
Gets the id that this integration uses for "subscribers".- Returns:
- The id that this integration uses for "subscribers".
-
getSubscriberRole
public Mono<Role> getSubscriberRole()
Requests to retrieve the role that this integration uses for "subscribers".
-
getSubscriberRole
public Mono<Role> getSubscriberRole(EntityRetrievalStrategy retrievalStrategy)
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
public Optional<Integration.ExpireBehavior> getExpireBehavior()
Gets the behavior of expiring subscribers, if present.- Returns:
- The behavior of expiring subscribers, if present.
-
getExpireGracePeriod
public Optional<Integer> getExpireGracePeriod()
Gets the grace period (in days) before expiring subscribers, if present.- Returns:
- The grace period (in days) before expiring subscribers, if present.
-
getUser
public Optional<User> getUser()
Gets the user for this integration, if present.- Returns:
- The user for this integration, if present.
-
getAccount
public IntegrationAccount getAccount()
Gets the integration account information.- Returns:
- The integration account information.
-
getSyncedAt
public Optional<Instant> getSyncedAt()
Gets when this integration was last synced, if present.- Returns:
- When this integration was last synced, if present.
-
getSubscriberCount
public Optional<Integer> 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
public Optional<IntegrationApplication> getApplication()
Gets the bot/OAuth2 application for discord integrations, if present.- Returns:
- The bot/OAuth2 application for discord integrations, if present.
-
-