Package net.dv8tion.jda.api.managers
Interface Presence
- 
 public interface PresenceThe Presence associated with the provided JDA instance- Since:
- 3.0
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description ActivitygetActivity()The current Activity for this session.JDAgetJDA()The JDA instance of this PresenceOnlineStatusgetStatus()The current OnlineStatus for this session.booleanisIdle()Whether the current session is marked as afk or not.voidsetActivity(Activity activity)Sets theActivityfor this session.voidsetIdle(boolean idle)Sets whether this session should be marked as afk or notvoidsetPresence(Activity activity, boolean idle)Sets two presence fields of this session.voidsetPresence(OnlineStatus status, boolean idle)Sets two presence fields of this session.voidsetPresence(OnlineStatus status, Activity activity)Sets two presence fields of this session.voidsetPresence(OnlineStatus status, Activity activity, boolean idle)Sets all presence fields of this session.voidsetStatus(OnlineStatus status)Sets theOnlineStatusfor this session
 
- 
- 
- 
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 OnlineStatusof 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 Activityof the current session or null if no activity is set
 
 - 
isIdleboolean 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
 
 - 
setStatusvoid setStatus(@Nullable OnlineStatus status)Sets theOnlineStatusfor this session- Parameters:
- status- the- OnlineStatusto be used (OFFLINE/null -> INVISIBLE)
- Throws:
- java.lang.IllegalArgumentException- if the provided OnlineStatus is- UNKNOWN
 
 - 
setActivityvoid setActivity(@Nullable Activity activity)Sets theActivityfor this session.
 An Activity can be retrieved viaActivity.playing(String). For streams you provide a valid streaming url as second parameterExamples: presence.setActivity(Activity.playing("Thrones"));presence.setActivity(Activity.streaming("Thrones", "https://twitch.tv/EasterEggs"));- Parameters:
- activity- An- Activityinstance or null to reset
- See Also:
- Activity.playing(String),- Activity.streaming(String, String)
 
 - 
setIdlevoid setIdle(boolean idle) Sets whether this session should be marked as afk or notThis is relevant to client accounts to monitor whether new messages should trigger mobile push-notifications. - Parameters:
- idle- boolean
 
 - 
setPresencevoid setPresence(@Nullable OnlineStatus status, @Nullable Activity activity, boolean idle)Sets all presence fields of this session.- Parameters:
- status- The- OnlineStatusfor this session (See- setStatus(OnlineStatus))
- activity- The- Activityfor this session (See- setActivity(net.dv8tion.jda.api.entities.Activity)for more info)
- idle- Whether to mark this session as idle (useful for client accounts- setIdle(boolean))
- Throws:
- java.lang.IllegalArgumentException- If the specified OnlineStatus is- UNKNOWN
 
 - 
setPresencevoid setPresence(@Nullable OnlineStatus status, @Nullable Activity activity)Sets two presence fields of this session.
 The third field stays untouched.- Parameters:
- status- The- OnlineStatusfor this session (See- setStatus(OnlineStatus))
- activity- The- Activityfor this session (See- setActivity(net.dv8tion.jda.api.entities.Activity)for more info)
- Throws:
- java.lang.IllegalArgumentException- If the specified OnlineStatus is- UNKNOWN
 
 - 
setPresencevoid setPresence(@Nullable OnlineStatus status, boolean idle)Sets two presence fields of this session.
 The third field stays untouched.- Parameters:
- status- The- OnlineStatusfor 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
 
 - 
setPresencevoid setPresence(@Nullable Activity activity, boolean idle)Sets two presence fields of this session.
 The third field stays untouched.- Parameters:
- activity- The- Activityfor this session (See- setActivity(net.dv8tion.jda.api.entities.Activity)for more info)
- idle- Whether to mark this session as idle (useful for client accounts- setIdle(boolean))
 
 
- 
 
-