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 class
Integration.ExpireBehavior
Represents the various integration expire behaviors.
-
Constructor Summary
Constructors Constructor Description Integration(GatewayDiscordClient gateway, discord4j.discordjson.json.IntegrationData data, long guildId)
Constructs anIntegration
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
IntegrationAccount
getAccount()
Gets the integration account information.Optional<IntegrationApplication>
getApplication()
Gets the bot/OAuth2 application for discord integrations, if present.GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.IntegrationData
getData()
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.Snowflake
getGuildId()
Gets the ID of the guild this integration is associated to.Snowflake
getId()
Gets the Snowflake that uniquely identifies this entity.String
getName()
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.String
getType()
Gets the integration type (twitch, youtube, or discord).Optional<User>
getUser()
Gets the user for this integration, if present.int
hashCode()
boolean
isEnabled()
Gets whether the integration is enabled.boolean
isEnableEmoticons()
Gets whether emoticons should be synced for this integration (twitch only currently).boolean
isRevoked()
Gets whether integration has been revoked.boolean
isSyncing()
Gets whether the integration is syncing.String
toString()
-
-
-
Constructor Detail
-
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 Detail
-
getClient
public GatewayDiscordClient 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
public Snowflake getId()
Description copied from interface:Entity
Gets 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.
-
-