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

233
Views
Tome dos variables de un mensaje y póngalas en diferentes partes

Estoy tratando de hacer un comando en discord.js .

Quiero hacerlo donde ?party (link or something here) requirements: be cool se escribe y luego diría

@user ha hecho ping para la fiesta Enlace: (enlace que se publicó) requisitos: sé genial

Soy nuevo en discord.js , así que estoy tratando de aprender. ¡Gracias!

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

0

Bueno, probablemente cambie su comando para que sea algo como:

?party (link) (be cool) . Mantén las cosas simples :)

Luego, podría analizar el contenido del comando y separar el enlace de los requisitos, así:

 text = message.content; // check if the text is a command for your bot if (text.startsWith("?party")) { // convert the contents of the command to an array, by splitting the text at spaces // Also get the rid of the command itself (?party) commandContents = text.split(" ").slice(1); link = commandContents[0]; requirements = commandContents.slice(1).join(" "); // join the requirements back by spaces. if (!link) { message.channel.send(" no link"); } else if (!requirements) { message.channel.send(" no requirements"); } else { message.channel.send( `<@${message.author.id}> has pinged for party\n \n Link: ${link}]\n\nRequirements:${requirements}\n\n@everyone` ); } }
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!