Class ActivityManager
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptRequest
(long userId) Accepts a game invitation from another user.void
acceptRequest
(long userId, Consumer<Result> callback) Accepts a game invitation from another user.void
Clears the user's current presence.void
clearActivity
(Consumer<Result> callback) Clears the user's current presence.registerCommand
(String command) Registers a command for Discord to use to launch your game.registerSteam
(int steamId) Registers a Steam launch for your game.void
sendInvite
(long userId, ActivityActionType type, String content) Invites a user to join your game.void
sendInvite
(long userId, ActivityActionType type, String content, Consumer<Result> callback) Invites a user to join your game.void
sendRequestReply
(long userId, ActivityJoinRequestReply reply) Replies to an "Ask to join" request.void
sendRequestReply
(long userId, ActivityJoinRequestReply reply, Consumer<Result> callback) Replies to an "Ask to join" request.void
updateActivity
(Activity activity) Updates the user's current presence to a new activity.void
updateActivity
(Activity activity, Consumer<Result> callback) Updates the user's current presence to a new activity.
-
Method Details
-
registerCommand
Registers a command for Discord to use to launch your game.- Parameters:
command
- Custom protocol URL or path to an executable (including options arguments)- Returns:
- The
Result
of the operation - See Also:
-
registerSteam
Registers a Steam launch for your game.
The registered URI is steam://run-game-id/<id>
- Parameters:
steamId
- Steam ID of your game- Returns:
- The
Result
of the operation - See Also:
-
updateActivity
Updates the user's current presence to a new activity.
The
Core.DEFAULT_CALLBACK
is used to handle the returnedResult
.- Parameters:
activity
- New activity for the user.- See Also:
-
updateActivity
Updates the user's current presence to a new activity.
A custom callback is used to handle the returned
Result
.- Parameters:
activity
- New activity for the user.callback
- Callback to process the returnedResult
.- See Also:
-
clearActivity
public void clearActivity()Clears the user's current presence.
The
Core.DEFAULT_CALLBACK
is used to handle the returnedResult
.- See Also:
-
clearActivity
Clears the user's current presence.
A custom callback is used to handle the returned
Result
.- Parameters:
callback
- Callback to process the returnedResult
.- See Also:
-
sendRequestReply
Replies to an "Ask to join" request.
The
Core.DEFAULT_CALLBACK
is used to handle the returnedResult
.- Parameters:
userId
- ID of user who asked to joinreply
- Type of reply to send- See Also:
-
sendRequestReply
public void sendRequestReply(long userId, ActivityJoinRequestReply reply, Consumer<Result> callback) Replies to an "Ask to join" request.
A custom callback is used to handle the returned
Result
.- Parameters:
userId
- ID of user who asked to joinreply
- Type of reply to sendcallback
- Callback to process the returnedResult
.- See Also:
-
sendInvite
Invites a user to join your game.
The
Core.DEFAULT_CALLBACK
is used to handle the returnedResult
.- Parameters:
userId
- ID of user to invitetype
- Type of invitation to sendcontent
- Content/message of the invitation- See Also:
-
sendInvite
public void sendInvite(long userId, ActivityActionType type, String content, Consumer<Result> callback) Invites a user to join your game.
A custom callback is used to handle the returned
Result
.- Parameters:
userId
- ID of user to invitetype
- Type of invitation to sendcontent
- Content/message of the invitationcallback
- Callback to process the returnedResult
.- See Also:
-
acceptRequest
public void acceptRequest(long userId) Accepts a game invitation from another user.
The
Core.DEFAULT_CALLBACK
is used to handle the returnedResult
.- Parameters:
userId
- ID of user to accept invitation from- See Also:
-
acceptRequest
Accepts a game invitation from another user.
A custom callback is used to handle the returned
Result
.- Parameters:
userId
- ID of user to accept invitation fromcallback
- Callback to process the returnedResult
.- See Also:
-