Class GuildImpl

java.lang.Object
com.mewna.catnip.entity.impl.guild.GuildImpl
All Implemented Interfaces:
Entity, Guild, HasApplication, HasIcon, HasName, HasNullableDescription, HasOwner, Snowflake, Timestamped, RequiresCatnip

public class GuildImpl extends Object implements Guild, RequiresCatnip, Timestamped
Since:
9/6/18.
Author:
natanbc
  • Constructor Details

  • Method Details

    • catnip

      public void catnip(@Nonnull Catnip catnip)
      Specified by:
      catnip in interface RequiresCatnip
    • iconUrl

      @Nullable @CheckReturnValue public String iconUrl(@Nonnull ImageOptions options)
      Specified by:
      iconUrl in interface HasIcon
      Returns:
      The icon's CDN URL, with the specified options applied. Will be null if HasIcon.icon() is null, except in the case of a User.
    • splashUrl

      @Nullable @CheckReturnValue public String splashUrl(@Nonnull ImageOptions options)
      Description copied from interface: Guild
      The CDN URL of the guild's splash image.
      Specified by:
      splashUrl in interface Guild
      Parameters:
      options - The options to configure the URL returned.
      Returns:
      The CDN URL.
    • joinedAt

      @Nonnull public OffsetDateTime joinedAt()
      Specified by:
      joinedAt in interface Guild
      Returns:
      The date/time that the current user joined the guild at.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static GuildImpl.GuildImplBuilder builder()
    • catnip

      public Catnip catnip()
      Description copied from interface: Entity
      Returns the catnip instance associated with this entity.
      Specified by:
      catnip in interface Entity
      Returns:
      The catnip instance of this entity.
    • idAsLong

      public long idAsLong()
      Description copied from interface: Snowflake
      The ID of this snowflake, as a long.
      Specified by:
      idAsLong in interface Snowflake
      Returns:
      Long representing the ID.
    • name

      public String name()
      Specified by:
      name in interface HasName
    • icon

      public String icon()
      Specified by:
      icon in interface HasIcon
      Returns:
      The icon's hash. May be null, in cases like a user not setting an avatar, no guild icon, ...
    • splash

      public String splash()
      Specified by:
      splash in interface Guild
      Returns:
      The splash image for the guild. May be null.
    • owned

      public boolean owned()
      Specified by:
      owned in interface Guild
      Returns:
      Whether the guild is owned by the current user.
    • ownerIdAsLong

      public long ownerIdAsLong()
      Specified by:
      ownerIdAsLong in interface Guild
      Specified by:
      ownerIdAsLong in interface HasOwner
      Returns:
      The id of the user who owns the guild.
    • permissions

      public Set<Permission> permissions()
      Specified by:
      permissions in interface Guild
      Returns:
      Total permissions for the user in the guild. Does NOT include channel overrides.
    • region

      public String region()
      Specified by:
      region in interface Guild
      Returns:
      The region that the guild's voice servers are located in.
    • afkChannelIdAsLong

      public long afkChannelIdAsLong()
      Specified by:
      afkChannelIdAsLong in interface Guild
      Returns:
      The id of the afk voice channel for the guild.
    • afkTimeout

      public int afkTimeout()
      Specified by:
      afkTimeout in interface Guild
      Returns:
      The amount of time a user must be afk for before they're moved to the afk channel.
    • verificationLevel

      public Guild.VerificationLevel verificationLevel()
      Specified by:
      verificationLevel in interface Guild
      Returns:
      The verification level set for the guild.
    • defaultMessageNotifications

      public Guild.NotificationLevel defaultMessageNotifications()
      Specified by:
      defaultMessageNotifications in interface Guild
      Returns:
      The notification level set for the guild.
    • explicitContentFilter

      public Guild.ContentFilterLevel explicitContentFilter()
      Specified by:
      explicitContentFilter in interface Guild
      Returns:
      The explicit content filter level set for the guild.
    • features

      public List<GuildFeature> features()
      Specified by:
      features in interface Guild
      Returns:
      The list of features enabled for the guild.
    • mfaLevel

      public Guild.MFALevel mfaLevel()
      Specified by:
      mfaLevel in interface Guild
      Returns:
      The MFA level set for guild administrators.
    • applicationIdAsLong

      public long applicationIdAsLong()
      Specified by:
      applicationIdAsLong in interface HasApplication
      Returns:
      The id of the application that this entity belongs to.
    • widgetEnabled

      public boolean widgetEnabled()
      Specified by:
      widgetEnabled in interface Guild
      Returns:
      Whether or not the guild's widget is enabled.
    • widgetChannelIdAsLong

      public long widgetChannelIdAsLong()
      Specified by:
      widgetChannelIdAsLong in interface Guild
      Returns:
      The channel the guild's widget is set for, if enabled.
    • systemChannelIdAsLong

      public long systemChannelIdAsLong()
      Specified by:
      systemChannelIdAsLong in interface Guild
      Returns:
      The id of the channel used for system messages (ex. the built-in member join messages).
    • large

      public boolean large()
      Specified by:
      large in interface Guild
      Returns:
      Whether or not this guild is considered "large."
    • unavailable

      public boolean unavailable()
      Specified by:
      unavailable in interface Guild
      Returns:
      Whether or not this guild is currently unavailable.
    • maxPresences

      public int maxPresences()
      Specified by:
      maxPresences in interface Guild
      Returns:
      The maximum number of presences the guild can have. Will be 0 if no value was present.
    • maxMembers

      public int maxMembers()
      Specified by:
      maxMembers in interface Guild
      Returns:
      The maximum number of members the guild can have. Will be 0 if no value was present.
    • approximateMemberCount

      public int approximateMemberCount()
      Specified by:
      approximateMemberCount in interface Guild
      Returns:
      The approximate member count the guild currently has. Will be 0 if no value was present.
    • approximatePresenceCount

      public int approximatePresenceCount()
      Specified by:
      approximatePresenceCount in interface Guild
      Returns:
      The approximate presence count the guild currently has. Will be 0 if no value was present.
    • vanityUrlCode

      public String vanityUrlCode()
      Specified by:
      vanityUrlCode in interface Guild
      Returns:
      The vanity invite code for this guild, ie. discord.gg/vanity_code.
    • description

      public String description()
      Specified by:
      description in interface HasNullableDescription
      Returns:
      The entity's description. May be null.
    • banner

      public String banner()
      Specified by:
      banner in interface Guild
      Returns:
      The guild's banner hash.
    • premiumTier

      public Guild.PremiumTier premiumTier()
      Specified by:
      premiumTier in interface Guild
      Returns:
      The guild's Nitro Boost tier.
    • premiumSubscriptionCount

      public int premiumSubscriptionCount()
      Specified by:
      premiumSubscriptionCount in interface Guild
      Returns:
      The number of members providing Nitro Boosts to this guild.
    • preferredLocale

      public String preferredLocale()
      Specified by:
      preferredLocale in interface Guild
      Returns:
      The preferred locale for this guild. Defaults to en-US. Is only modifiable on guilds that have GuildFeature.DISCOVERABLE set.
    • idAsLong

      public GuildImpl idAsLong(long idAsLong)
      Returns:
      this.
    • name

      public GuildImpl name(String name)
      Returns:
      this.
    • icon

      public GuildImpl icon(String icon)
      Returns:
      this.
    • splash

      public GuildImpl splash(String splash)
      Returns:
      this.
    • owned

      public GuildImpl owned(boolean owned)
      Returns:
      this.
    • ownerIdAsLong

      public GuildImpl ownerIdAsLong(long ownerIdAsLong)
      Returns:
      this.
    • permissions

      public GuildImpl permissions(Set<Permission> permissions)
      Returns:
      this.
    • region

      public GuildImpl region(String region)
      Returns:
      this.
    • afkChannelIdAsLong

      public GuildImpl afkChannelIdAsLong(long afkChannelIdAsLong)
      Returns:
      this.
    • afkTimeout

      public GuildImpl afkTimeout(int afkTimeout)
      Returns:
      this.
    • verificationLevel

      public GuildImpl verificationLevel(Guild.VerificationLevel verificationLevel)
      Returns:
      this.
    • defaultMessageNotifications

      public GuildImpl defaultMessageNotifications(Guild.NotificationLevel defaultMessageNotifications)
      Returns:
      this.
    • explicitContentFilter

      public GuildImpl explicitContentFilter(Guild.ContentFilterLevel explicitContentFilter)
      Returns:
      this.
    • features

      public GuildImpl features(List<GuildFeature> features)
      Returns:
      this.
    • mfaLevel

      public GuildImpl mfaLevel(Guild.MFALevel mfaLevel)
      Returns:
      this.
    • applicationIdAsLong

      public GuildImpl applicationIdAsLong(long applicationIdAsLong)
      Returns:
      this.
    • widgetEnabled

      public GuildImpl widgetEnabled(boolean widgetEnabled)
      Returns:
      this.
    • widgetChannelIdAsLong

      public GuildImpl widgetChannelIdAsLong(long widgetChannelIdAsLong)
      Returns:
      this.
    • systemChannelIdAsLong

      public GuildImpl systemChannelIdAsLong(long systemChannelIdAsLong)
      Returns:
      this.
    • joinedAt

      public GuildImpl joinedAt(String joinedAt)
      Returns:
      this.
    • large

      public GuildImpl large(boolean large)
      Returns:
      this.
    • unavailable

      public GuildImpl unavailable(boolean unavailable)
      Returns:
      this.
    • maxPresences

      public GuildImpl maxPresences(int maxPresences)
      Returns:
      this.
    • maxMembers

      public GuildImpl maxMembers(int maxMembers)
      Returns:
      this.
    • approximateMemberCount

      public GuildImpl approximateMemberCount(int approximateMemberCount)
      Returns:
      this.
    • approximatePresenceCount

      public GuildImpl approximatePresenceCount(int approximatePresenceCount)
      Returns:
      this.
    • vanityUrlCode

      public GuildImpl vanityUrlCode(String vanityUrlCode)
      Returns:
      this.
    • description

      public GuildImpl description(String description)
      Returns:
      this.
    • banner

      public GuildImpl banner(String banner)
      Returns:
      this.
    • premiumTier

      public GuildImpl premiumTier(Guild.PremiumTier premiumTier)
      Returns:
      this.
    • premiumSubscriptionCount

      public GuildImpl premiumSubscriptionCount(int premiumSubscriptionCount)
      Returns:
      this.
    • preferredLocale

      public GuildImpl preferredLocale(String preferredLocale)
      Returns:
      this.