MELOUN7
MELOUN7
DIdiscord.js - Imagine ❄
Created by MELOUN7 on 9/27/2023 in #djs-questions
Discord.js RPC Extenstion Activity Type
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;
3 replies