Package org.javacord.api.event.user
Interface OptionalUserEvent
-
- All Superinterfaces:
Event
- All Known Subinterfaces:
ReactionAddEvent,ReactionRemoveEvent,SingleReactionEvent,UserChangeActivityEvent,UserChangeStatusEvent,UserStartTypingEvent
public interface OptionalUserEvent extends Event
An optional user event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<User>getUser()Gets the user of the event.longgetUserId()Gets the id of the user involved in the event.default java.lang.StringgetUserIdAsString()Gets the id of the user involved in the event.default java.util.concurrent.CompletableFuture<User>requestUser()Requests a user from Discord with the given id.
-
-
-
Method Detail
-
getUserId
long getUserId()
Gets the id of the user involved in the event.- Returns:
- The id of the user involved in the event.
-
getUserIdAsString
default java.lang.String getUserIdAsString()
Gets the id of the user involved in the event.- Returns:
- The id of the user involved in the event.
- See Also:
getUserId()
-
getUser
default java.util.Optional<User> getUser()
Gets the user of the event.- Returns:
- The user of the event.
-
requestUser
default java.util.concurrent.CompletableFuture<User> requestUser()
Requests a user from Discord with the given id.If the user is in the cache, the user is served from the cache.
- Returns:
- The user.
-
-