Constructor and Description |
---|
PresenceImpl(JDAImpl jda)
Creates a new Presence representation for the provided JDAImpl instance
|
Modifier and Type | Method and Description |
---|---|
org.json.JSONObject |
getFullPresence() |
Game |
getGame()
The current Game for this session.
This might not be what the Discord Client displays due to session clashing! |
JDA |
getJDA()
The JDA instance of this Presence
|
OnlineStatus |
getStatus()
The current OnlineStatus for this session.
This might not be what the Discord Client displays due to session clashing! |
boolean |
isIdle()
Whether the current session is marked as afk or not
|
PresenceImpl |
setCacheGame(Game game) |
PresenceImpl |
setCacheIdle(boolean idle) |
PresenceImpl |
setCacheStatus(OnlineStatus status) |
void |
setGame(Game game)
Sets the
Game for this session |
void |
setIdle(boolean idle)
Sets whether this session should be marked as afk or not
|
void |
setStatus(OnlineStatus status)
Sets the
OnlineStatus for this session |
protected void |
update(org.json.JSONObject data) |
public PresenceImpl(JDAImpl jda)
jda
- The not-null JDAImpl instance to usepublic JDA getJDA()
Presence
public OnlineStatus getStatus()
Presence
getStatus
in interface Presence
OnlineStatus
of the current sessionpublic Game getGame()
Presence
public boolean isIdle()
Presence
public void setStatus(OnlineStatus status)
Presence
OnlineStatus
for this sessionsetStatus
in interface Presence
status
- the OnlineStatus
to be used (OFFLINE/null -> INVISIBLE)public void setGame(Game game)
Presence
Game
for this sessionsetGame
in interface Presence
game
- A Game
instance or null to resetGame.of(String)
,
Game.of(String, String)
public void setIdle(boolean idle)
Presence
public PresenceImpl setCacheStatus(OnlineStatus status)
public PresenceImpl setCacheGame(Game game)
public PresenceImpl setCacheIdle(boolean idle)
public org.json.JSONObject getFullPresence()
protected void update(org.json.JSONObject data)