Discord.js RPC Extenstion Activity Type

Hello I'm trying to make the RPC have a place to play the game Listens.. but I can't do it I'm not talking about Discord bot but about Electron application, here is the code.
2 Replies
d.js toolkit
d.js toolkit9mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
MELOUN7
MELOUN79mo ago
const { listeners } = require('process');

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

rpc.on('ready', () => {
console.log("Discord RPC is ready");
rpc.setActivity({
details: 'Greate Song',
state: 'Listening to',
startTimestamp: new Date(),
largeImageKey: 'logo',
largeImageText: 'test',
smallImageKey: 'logo',
smallImageText: 'Test',
instance: false,
buttons: [{ label: "Listen Now", url: "https://test.com/" }],
type: 2,
});
});

rpc.login({ clientId }).catch(console.error);
}

module.exports = rpc;
const { listeners } = require('process');

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

rpc.on('ready', () => {
console.log("Discord RPC is ready");
rpc.setActivity({
details: 'Greate Song',
state: 'Listening to',
startTimestamp: new Date(),
largeImageKey: 'logo',
largeImageText: 'test',
smallImageKey: 'logo',
smallImageText: 'Test',
instance: false,
buttons: [{ label: "Listen Now", url: "https://test.com/" }],
type: 2,
});
});

rpc.login({ clientId }).catch(console.error);
}

module.exports = rpc;