Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Callback and RPC not running. #42

Open
Stanlyhalo opened this issue Jun 9, 2020 · 1 comment
Open

Callback and RPC not running. #42

Stanlyhalo opened this issue Jun 9, 2020 · 1 comment

Comments

@Stanlyhalo
Copy link

Stanlyhalo commented Jun 9, 2020

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();
@CDFN
Copy link

CDFN commented Jan 25, 2021

Facing same issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants