public interface Presence
Modifier and Type | Method | Description |
---|---|---|
Game |
getGame() |
The current Game for this session.
|
JDA |
getJDA() |
The JDA instance of this Presence
|
OnlineStatus |
getStatus() |
The current OnlineStatus for this session.
|
boolean |
isIdle() |
Whether the current session is marked as afk or not.
|
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 |
setPresence(Game game,
boolean idle) |
Sets two presence fields of this session.
|
void |
setPresence(OnlineStatus status,
boolean idle) |
Sets two presence fields of this session.
|
void |
setPresence(OnlineStatus status,
Game game) |
Sets two presence fields of this session.
|
void |
setPresence(OnlineStatus status,
Game game,
boolean idle) |
Sets all presence fields of this session.
|
void |
setStatus(OnlineStatus status) |
Sets the
OnlineStatus for this session |
JDA getJDA()
OnlineStatus getStatus()
OnlineStatus
of the current sessionGame getGame()
Game
of the current session or null if no game is setboolean isIdle()
This is relevant to client accounts to monitor whether new messages should trigger mobile push-notifications.
void setStatus(OnlineStatus status)
OnlineStatus
for this sessionstatus
- the OnlineStatus
to be used (OFFLINE/null -> INVISIBLE)java.lang.IllegalArgumentException
- if the provided OnlineStatus is UNKNOWN
void setGame(Game game)
Game
for this session.
Game.playing(String)
.
For streams you provide a valid streaming url as second parameter
Examples:
presence.setGame(Game.playing("Thrones"));
presence.setGame(Game.streaming("Thrones", "https://twitch.tv/EasterEggs"));
game
- A Game
instance or null to resetGame.playing(String)
,
Game.streaming(String, String)
void setIdle(boolean idle)
This is relevant to client accounts to monitor whether new messages should trigger mobile push-notifications.
idle
- booleanvoid setPresence(OnlineStatus status, Game game, boolean idle)
status
- The OnlineStatus
for this session
(See setStatus(OnlineStatus)
)game
- The Game
for this session
(See setGame(Game)
for more info)idle
- Whether to mark this session as idle (useful for client accounts setIdle(boolean)
)java.lang.IllegalArgumentException
- If the specified OnlineStatus is UNKNOWN
void setPresence(OnlineStatus status, Game game)
status
- The OnlineStatus
for this session
(See setStatus(OnlineStatus)
)game
- The Game
for this session
(See setGame(Game)
for more info)java.lang.IllegalArgumentException
- If the specified OnlineStatus is UNKNOWN
void setPresence(OnlineStatus status, boolean idle)
status
- The OnlineStatus
for this session
(See setStatus(OnlineStatus)
)idle
- Whether to mark this session as idle (useful for client accounts setIdle(boolean)
)java.lang.IllegalArgumentException
- If the specified OnlineStatus is UNKNOWN
void setPresence(Game game, boolean idle)
game
- The Game
for this session
(See setGame(Game)
for more info)idle
- Whether to mark this session as idle (useful for client accounts setIdle(boolean)
)