Interface Emote

    • Method Detail

      • getGuild

        @Nullable
        Guild getGuild()
        The Guild this emote is attached to.

        This is null if the emote is fake (retrieved from a Message)

        Returns:
        Guild of this emote or null if it is a fake entity
      • canProvideRoles

        boolean canProvideRoles()
        Whether this Emote has an attached roles list. This might not be the case when the emote is retrieved through special cases like audit-logs.

        If this is not true then getRoles() will throw IllegalStateException.

        Returns:
        True, if this emote has an attached roles list
      • getName

        @Nonnull
        String getName()
        The name of this emote
        Returns:
        String representation of this emote's name
      • isManaged

        boolean isManaged()
        Whether this emote is managed. A managed Emote is controlled by Discord, not the Guild administrator, typical via a service like BBTV in conjunction with Twitch.
        Learn More
        Returns:
        True, if this emote is managed
      • getJDA

        @Nonnull
        JDA getJDA()
        The JDA instance of this Emote
        Returns:
        The JDA instance of this Emote
      • isAnimated

        boolean isAnimated()
        Whether or not this Emote is animated.

        Animated Emotes are available to Discord Nitro users as well as Bot accounts.

        Returns:
        Whether the Emote is animated or not.
      • getImageUrl

        @Nonnull
        default String getImageUrl()
        A String representation of the URL which leads to image displayed within the official Discord™ client when this Emote is used
        Returns:
        Discord CDN link to the Emote's image
      • canInteract

        default boolean canInteract​(Member issuer)
        Whether the specified Member can interact with this Emote
        Parameters:
        issuer - The User to test
        Returns:
        True, if the provided Member can use this Emote
        See Also:
        PermissionUtil.canInteract(Member, Emote), PermissionUtil.canInteract(User, Emote, MessageChannel)
      • canInteract

        default boolean canInteract​(User issuer,
                                    MessageChannel channel)
        Whether the specified User can interact with this Emote within the provided MessageChannel
        Same logic as canInteract(issuer, channel, true)!
        Parameters:
        issuer - The User to test
        channel - The MessageChannel to test
        Returns:
        True, if the provided Member can use this Emote
        See Also:
        PermissionUtil.canInteract(Member, Emote), PermissionUtil.canInteract(User, Emote, MessageChannel)
      • canInteract

        default boolean canInteract​(User issuer,
                                    MessageChannel channel,
                                    boolean botOverride)
        Whether the specified User can interact with this Emote within the provided MessageChannel
        Special override to exclude elevated bot permissions in case of (for instance) reacting to messages.
        Parameters:
        issuer - The User to test
        channel - The MessageChannel to test
        botOverride - Whether bots can use non-managed emotes in other guilds
        Returns:
        True, if the provided Member can use this Emote
        See Also:
        PermissionUtil.canInteract(Member, Emote), PermissionUtil.canInteract(User, Emote, MessageChannel, boolean)