Interface KnownCustomEmoji

    • Method Detail

      • getServer

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

        default CompletableFuture<Void> delete​()
        Deletes the emoji.
        Returns:
        A future to tell us if the deletion was successful.
      • delete

        CompletableFuture<Void> delete​(String reason)
        Deletes the emoji.
        Parameters:
        reason - The reason for the deletion.
        Returns:
        A future to tell us if the deletion was successful.
      • createUpdater

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

        Optional<Collection<Role>> getWhitelistedRoles​()
        Gets a list with all whitelisted roles.
        Returns:
        A list with 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.
      • updateName

        default CompletableFuture<Void> updateName​(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 CompletableFuture<Void> updateWhitelist​(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 CompletableFuture<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 CompletableFuture<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 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<Emoji>
        Returns:
        The current cached instance.