This repository was archived by the owner on Apr 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
This repository was archived by the owner on Apr 9, 2023. It is now read-only.
Callback and RPC not running. #42
Copy link
Copy link
Open
Description
So I'm trying to log the user username + tag (given my the readme), but it's not running the callback and it's not making my profile show I'm playing something
public void check(Logger LOGGER)
{
LOGGER.info("Getting USER.");
DiscordEventHandlers handlers = new DiscordEventHandlers.Builder().setReadyEventHandler((user) -> {
LOGGER.info("Got USER.");
LOGGER.info("Welcome " + user.username + "#" + user.discriminator + "!");
}).build();
DiscordRPC.discordInitialize( client ID of the bot , handlers, true);
DiscordRPC.discordRegister( client ID of the bot , "");
}
public DiscordRichPresence createRPC(Logger LOGGER)
{
DiscordRichPresence rich = new DiscordRichPresence.Builder("This is the current state.").setDetails("These are some details.").build();
return rich;
}
public void updateRPC(Logger LOGGER, DiscordRichPresence rich)
{
DiscordRPC.discordRunCallbacks();
DiscordRPC.discordUpdatePresence(rich);
}Each function is called from top to bottom, what am I doing wrong?
Edit*: I made the RP work, but the ".setReadyEventListener()" isn't work, here's the event code now (and I do have a thread that loops, and runs "DiscordRPC.discordRunCallbacks();"):
DiscordEventHandlers handlers = new DiscordEventHandlers.Builder().setReadyEventHandler(new ReadyCallback() {
@Override
public void apply(DiscordUser user) {
LOGGER.info("DiscordManager: Got user" + user.username + "#" + user.discriminator);
}
}).build();Metadata
Metadata
Assignees
Labels
No labels