Class GuildEmoji

    • Constructor Detail

      • GuildEmoji

        public GuildEmoji​(ServiceMediator serviceMediator,
                          GuildEmojiBean data,
                          long guildId)
        Constructs a GuildEmoji with an associated ServiceMediator and Discord data.
        Parameters:
        serviceMediator - The ServiceMediator 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 emoji is associated to.
    • Method Detail

      • getClient

        public DiscordClient getClient()
        Description copied from interface: DiscordObject
        Gets the DiscordClient associated to this object.
        Specified by:
        getClient in interface DiscordObject
        Returns:
        The DiscordClient associated to this object.
      • getId

        public Snowflake getId()
        Description copied from interface: Entity
        Gets the Snowflake that uniquely identifies this entity.
        Specified by:
        getId in interface Entity
        Returns:
        The Snowflake that uniquely identifies this entity.
      • getName

        public String getName()
        Gets the emoji name.
        Returns:
        The emoji name.
      • getRoleIds

        public Set<Snowflake> getRoleIds()
        Gets the IDs of the roles this emoji is whitelisted to.
        Returns:
        The IDs of the roles this emoji is whitelisted to.
      • getRoles

        public reactor.core.publisher.Flux<Role> getRoles()
        Requests to retrieve the roles this emoji is whitelisted to.

        The returned Flux will emit items in order based off their natural position, which is indicated visually in the Discord client. For roles, the "lowest" role will be emitted first.

        Returns:
        A Flux that continually emits the roles this emoji is whitelisted for. if an error is received, it is emitted through the Flux.
      • getUser

        public reactor.core.publisher.Mono<User> getUser()
        Requests to retrieve the user that created this emoji.
        Returns:
        A Mono where, upon successful completion, emits the user that created this emoji. If an error is received, it is emitted through the Mono.
      • requiresColons

        public boolean requiresColons()
        Gets whether this emoji must be wrapped in colons.
        Returns:
        true if this emoji must be wrapped in colons, false otherwise.
      • isManaged

        public boolean isManaged()
        Gets whether this emoji is managed.
        Returns:
        true if this emoji is managed, false otherwise.
      • isAnimated

        public boolean isAnimated()
        Gets whether this emoji is animated.
        Returns:
        true if this emoji is animated, false otherwise.
      • getGuildId

        public Snowflake getGuildId()
        Gets the ID of the guild this emoji is associated to.
        Returns:
        The ID of the guild this emoji is associated to.
      • getGuild

        public reactor.core.publisher.Mono<Guild> getGuild()
        Requests to retrieve the guild this emoji is associated to.
        Returns:
        A Mono where, upon successful completion, emits the guild this emoji is associated to. If an error is received, it is emitted through the Mono.
      • edit

        public reactor.core.publisher.Mono<GuildEmoji> edit​(Consumer<? super GuildEmojiEditSpec> spec)
        Requests to edit this guild emoji.
        Parameters:
        spec - A Consumer that provides a "blank" GuildEmojiEditSpec to be operated on.
        Returns:
        A Mono where, upon successful completion, emits the edited GuildEmoji. If an error is received, it is emitted through the Mono.
      • delete

        public reactor.core.publisher.Mono<Void> delete()
        Requests to delete this emoji.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the emoji has been deleted. If an error is received, it is emitted through the Mono.
      • delete

        public reactor.core.publisher.Mono<Void> delete​(@Nullable
                                                        String reason)
        Requests to delete this emoji while optionally specifying a reason.
        Parameters:
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the emoji has been deleted. If an error is received, it is emitted through the Mono.
      • getImageUrl

        public String getImageUrl()
        Gets the URL for this guild emoji.
        Returns:
        The URL for this guild emoji.
      • asFormat

        public String asFormat()
        Gets the formatted version of this emoji (i.e., to display in the client).
        Returns:
        The formatted version of this emoji (i.e., to display in the client).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object