Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
matar un proceso secundario en ejecución en discord.js

Estoy tratando de matar/acceder a un proceso. Debería iniciar otro bot y también poder matarlo. Esto es lo que he hecho.

 const { Client, Intents, DiscordAPIError } = require("discord.js"); const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS] }); const fs = require('fs'); const Discord = require (`discord.js`) const child = require (`child_process`) module.exports = { name: `start`, description: `start the bot`, execute(message, args){ child.exec(`node test.js`, (stderr, stdout) => { message.channel.send(`stderr: ${stderr}, stdout: ${stdout}`) }) } }

Este es el comando donde quiero detener el bot.

 const { Client, Intents, DiscordAPIError } = require("discord.js"); const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS] }); const fs = require('fs'); const Discord = require (`discord.js`) const child = require (`child_process`) module.exports = { name: `stop`, description: `stop the bot`, execute(message, args){ //no idea what to put here }) } }

¿Puedo obtener la identificación del proceso o guardar algo en una variable para acceder al proceso? Gracias por ayudar ;)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto terminará su programa

 process.exit()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!