Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
if discord rpc cant find discord running how to make it refresh

Hi so my problem is that when i run my application which uses discord-rpc it connects to discord if it is already running. However if Discord is not running and the application is launched before Discord the rpc will not connect to discord automatically. How can i make this code sort of refresh say every 10 seconds

rpc = require("discord-rpc")
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
    client.request('SET_ACTIVITY', {
        pid: process.pid,
        

        
        activity : {
            details : "Loading Melody (Beta)",
            
           
            assets : {
                large_image : ""
                large_text : "This Is A Test"
            },
            
            buttons : [{label : "Download Melody" , url : "https://github.com/unofficialdxnny/Melody"}]
        
        
        }
        
    })
    

})

client.login({ clientId : "token" } ).catch(console.error);

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First of all, make a Boolean which is saved globally. Now if you can successfully login, set it to true. Now wrap the whole code in a set interval, and a if condition based on that boolean to check whether do you need to run the code again or not. You probably need to run the client login part in that set interval.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda