Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not connect #365

Open
XqMine opened this issue May 30, 2022 · 1 comment
Open

Error: Could not connect #365

XqMine opened this issue May 30, 2022 · 1 comment

Comments

@XqMine
Copy link

XqMine commented May 30, 2022

hi, i have a problem, when i run my project i get this error
image
my code:

const clientId = '973698144086945872';
const DiscordRPC = require('discord-rpc');
const RPC = new DiscordRPC.Client({ transport: 'ipc'});

DiscordRPC.register(clientId);

async function setActivity() {
    if (!RPC) return;
    RPC.setActivity({

        startTimestamp: Date.now(),
        endTimestamp: Date.now(),
        largeImageKey: 'anya',
        largeImageText: `Anya forger`,
        smallImageKey: `midorya`,
        smallImageText: `zWmin`,
        instance: true,


    });
};

RPC.on('ready', async () => {
    setActivity();

    setInterval(() => {
        setActivity();
    }, 15 * 1000);
});

RPC.login({ clientId }).catch(err => console.error(err));

i hope someone can help me

@Lachee
Copy link
Contributor

Lachee commented May 30, 2022

make sure the discord client is running on the same computer.
Additionally, ask the DiscordRPC.js library.

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

No branches or pull requests

2 participants