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', 
});


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..
image.png
Was this page helpful?