Interface Presence


  • public interface Presence
    The Presence associated with the provided JDA instance
    Since:
    3.0
    • Method Detail

      • getJDA

        @Nonnull
        JDA getJDA()
        The JDA instance of this Presence
        Returns:
        The current JDA instance
      • getStatus

        @Nonnull
        OnlineStatus getStatus()
        The current OnlineStatus for this session.
        This might not be what the Discord Client displays due to session clashing!
        Returns:
        The OnlineStatus of the current session
      • getActivity

        @Nullable
        Activity getActivity()
        The current Activity for this session.
        This might not be what the Discord Client displays due to session clashing!
        Returns:
        The Activity of the current session or null if no activity is set
      • isIdle

        boolean isIdle()
        Whether the current session is marked as afk or not.

        This is relevant to client accounts to monitor whether new messages should trigger mobile push-notifications.

        Returns:
        True if this session is marked as afk
      • setStatus

        void setStatus​(@Nullable
                       OnlineStatus status)
        Sets the OnlineStatus for this session
        Parameters:
        status - the OnlineStatus to be used (OFFLINE/null -> INVISIBLE)
        Throws:
        java.lang.IllegalArgumentException - if the provided OnlineStatus is UNKNOWN
      • setIdle

        void setIdle​(boolean idle)
        Sets whether this session should be marked as afk or not

        This is relevant to client accounts to monitor whether new messages should trigger mobile push-notifications.

        Parameters:
        idle - boolean
      • setPresence

        void setPresence​(@Nullable
                         OnlineStatus status,
                         boolean idle)
        Sets two presence fields of this session.
        The third field stays untouched.
        Parameters:
        status - The OnlineStatus for this session (See setStatus(OnlineStatus))
        idle - Whether to mark this session as idle (useful for client accounts setIdle(boolean))
        Throws:
        java.lang.IllegalArgumentException - If the specified OnlineStatus is UNKNOWN