Interface KnownCustomEmoji

    • Method Detail

      • getServer

        Server getServer()
        Gets the server of the emoji.
        Returns:
        The server of the emoji.
      • createUpdater

        default CustomEmojiUpdater createUpdater()
        Creates an updater for this emoji.
        Returns:
        An updater for this emoji.
      • getWhitelistedRoles

        java.util.Optional<java.util.Set<Role>> getWhitelistedRoles()
        Gets all whitelisted roles.
        Returns:
        All whitelisted roles.
      • requiresColons

        boolean requiresColons()
        Checks if this emoji must be wrapped in colons.
        Returns:
        Whether this emoji must be wrapped in colons or not.
      • isManaged

        boolean isManaged()
        Checks if this emoji is managed.
        Returns:
        Whether this emoji is managed or not.
      • getCreator

        java.util.concurrent.CompletableFuture<java.util.Optional<User>> getCreator()
        Gets the creator of the emoji.
        Returns:
        The user who created the emoji.
      • updateName

        default java.util.concurrent.CompletableFuture<java.lang.Void> updateName​(java.lang.String name)
        Updates the name of the emoji.

        If you want to update several settings at once, it's recommended to use the CustomEmojiUpdater from createUpdater() which provides a better performance!

        Parameters:
        name - The new name of the emoji.
        Returns:
        A future to check if the update was successful.
      • updateWhitelist

        default java.util.concurrent.CompletableFuture<java.lang.Void> updateWhitelist​(java.util.Collection<Role> roles)
        Updates the whitelist of the emoji. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!

        If you want to update several settings at once, it's recommended to use the CustomEmojiUpdater from createUpdater() which provides a better performance!

        Parameters:
        roles - The new whitelist.
        Returns:
        A future to check if the update was successful.
      • updateWhitelist

        default java.util.concurrent.CompletableFuture<java.lang.Void> updateWhitelist​(Role... roles)
        Updates the whitelist of the emoji. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!

        If you want to update several settings at once, it's recommended to use the CustomEmojiUpdater from createUpdater() which provides a better performance!

        Parameters:
        roles - The new whitelist.
        Returns:
        A future to check if the update was successful.
      • removeWhitelist

        default java.util.concurrent.CompletableFuture<java.lang.Void> removeWhitelist()
        Removes the whitelist of the emoji.

        If you want to update several settings at once, it's recommended to use the CustomEmojiUpdater from createUpdater() which provides a better performance!

        Returns:
        A future to check if the update was successful.
      • getCurrentCachedInstance

        default java.util.Optional<KnownCustomEmoji> getCurrentCachedInstance()
        Description copied from interface: UpdatableFromCache
        Gets an updated instance of this entity from the cache. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache, that gets updates from Discord, in case this one was invalidated.

        This method returns the currently cached entity, or an empty Optional if the entity is not cached any longer, for example because it was deleted or the message was thrown out of the cache.

        Specified by:
        getCurrentCachedInstance in interface CustomEmoji
        Specified by:
        getCurrentCachedInstance in interface UpdatableFromCache<KnownCustomEmoji>
        Returns:
        The current cached instance.