discord-rpc

const RPC = require('discord-rpc');
const rpc = new RPC.Client({
transport: 'ipc'
});
const time = setInterval(() => {
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();

console.log(`Current time: ${hours}:${minutes}:${seconds}`);
return `Current time: ${hours}:${minutes}:${seconds}`
}, 1000);
rpc.on('ready', () => {
rpc.setActivity({

details: '💠・Join Fire Development',
state: time,
startTimestamp: new Date(),
largeImageKey: '',
largeImageText: 'Fire Development',
smallImageKey: 'small',
smallImageText: 'Flame Bot',
instance: true,
buttons: [{
label: 'Join Server',
url: ''
}, {
label: 'DONT Click This',
url: ''
}]
});

console.log('RPC online');
});

rpc.login({
clientId: 'x',
});
const RPC = require('discord-rpc');
const rpc = new RPC.Client({
transport: 'ipc'
});
const time = setInterval(() => {
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();

console.log(`Current time: ${hours}:${minutes}:${seconds}`);
return `Current time: ${hours}:${minutes}:${seconds}`
}, 1000);
rpc.on('ready', () => {
rpc.setActivity({

details: '💠・Join Fire Development',
state: time,
startTimestamp: new Date(),
largeImageKey: '',
largeImageText: 'Fire Development',
smallImageKey: 'small',
smallImageText: 'Flame Bot',
instance: true,
buttons: [{
label: 'Join Server',
url: ''
}, {
label: 'DONT Click This',
url: ''
}]
});

console.log('RPC online');
});

rpc.login({
clientId: 'x',
});
on my rich presence i want my time to keep changing continuously.. if i dont use setInterval then it only shows the time at which it started.. i want it to show my local time and it should get updated automatically every second.. the above code when tired gave me this error: also also why cant i put gifs for my largeimage... ?? ive seen people putting gifs in there.. im not able to uploads gifs onto the dev website.. so to test i put a gif link.. but that also doesnt work..
No description
2 Replies
d.js toolkit
d.js toolkit•5d 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! - ✅ Marked as resolved by OP
FiredragonPlayz
FiredragonPlayzOP•4d ago
If i put set interval inside the function then it gives me some error So it put it out.. One of the things I did kinda worked but it started bugging out .. ikik i was doing for fun 😂

Did you find this page helpful?