#Could not connect RPC
27 messages · Page 1 of 1 (latest)
const clientId = '1037707297587200090'
const DiscordRPC = require('discord-rpc')
const RPC = new DiscordRPC.Client({ transport: 'ipc' })
DiscordRPC.register(clientId)
async function setActivity() {
if(!RPC) return;
RPC.setActivity({
state: "Playing Solo",
details: "Competitive",
startTimestamp: Date.now(),
largeImageKey: `discord-icon`,
largeImageText: `Discord icon.`,
smallImageKey: `discord-icon`,
smallImageText: `Small icon.`,
instance: false,
buttons: [
{
label: 'Button',
url: 'https://www.google.com/'
}
]
})
}
RPC.on('ready', async () => {
setActive();
setInterval(() => {
setActive();
}, 15 * 1000);
})
Rpc.login({ clientId }).catch(err => console.error(err))```
transport not trasnport
@rare void
vs code?
whatever
Could not connect RPC
Do you have discord running on that PC?
So no… there’s your issue
There’s literally no reason to ping me in a post I already joined…
ok
And yes, RPC works with discord app
okay
i got this error
I’m guessing you wanted to call your function called setActivity instead of setActive. You must learn the basics of JavaScript before doing anything. (Well really programming since anyone with compsci knowledge would know that variable no exist in code snippet)
sorry
Don’t be sorry, everyone starts somewhere
thx it worked
np, but you should really learn what you’re actually doing