Package de.jcm.discordgamesdk
Class UserManager
java.lang.Object
de.jcm.discordgamesdk.UserManager
Manager to fetch information about Discord users, especially the current user.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
HypeSquad Events participantstatic final int
HypeSquad House Braverystatic final int
HypeSquad House Brilliancestatic final int
HypeSquad House Balancestatic final int
Discord Partner -
Method Summary
Modifier and TypeMethodDescriptionboolean
currentUserHasFlag
(int flag) Checks if the current user has a certain flag set.Fetches information about the current user.Fetches the type of premium subscription the current user has.void
getUser
(long userId, BiConsumer<Result, DiscordUser> callback) Fetches information about a Discord user.
-
Field Details
-
USER_FLAG_PARTNER
public static final int USER_FLAG_PARTNERDiscord Partner- See Also:
-
USER_FLAG_HYPE_SQUAD_EVENTS
public static final int USER_FLAG_HYPE_SQUAD_EVENTSHypeSquad Events participant- See Also:
-
USER_FLAG_HYPE_SQUAD_HOUSE1
public static final int USER_FLAG_HYPE_SQUAD_HOUSE1HypeSquad House Bravery- See Also:
-
USER_FLAG_HYPE_SQUAD_HOUSE2
public static final int USER_FLAG_HYPE_SQUAD_HOUSE2HypeSquad House Brilliance- See Also:
-
USER_FLAG_HYPE_SQUAD_HOUSE3
public static final int USER_FLAG_HYPE_SQUAD_HOUSE3HypeSquad House Balance- See Also:
-
-
Method Details
-
getCurrentUser
Fetches information about the current user.
You need to wait for a
DiscordEventAdapter.onCurrentUserUpdate()
to be fired, before using this method.- Returns:
- The current DiscordUser
- Throws:
GameSDKException
- if something went wrong fetching the user information- See Also:
-
getUser
Fetches information about a Discord user.
The user is provided to the callback together with the result of the operation.
- Parameters:
userId
- ID of the user to fetch information ofcallback
- Callback to provide the result to- See Also:
-
getCurrentUserPremiumType
Fetches the type of premium subscription the current user has.
- Returns:
- The PremiumType
- Throws:
GameSDKException
- if something went wrong fetching the user information- See Also:
-
currentUserHasFlag
public boolean currentUserHasFlag(int flag) Checks if the current user has a certain flag set.
- Parameters:
flag
- Flag to check the user for- Returns:
true
, if the user has the flag set,false
otherwise- Throws:
GameSDKException
- if something went wrong fetching the user information- See Also:
-