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

242
Views
Mi comando pasa pero no parece funcionar (no se elimina)

Hice un bot con algo de ayuda, soy un nuevo desarrollador, así que no sé mucho. Pero cuando hago $redeemkey 12345678 parece funcionar (el bot responde y la consola dice "verdadero") Pero una parte no funciona. La parte donde elimina el argumento del archivo txt. Cualquier ayuda es apreciada aquí está mi script:

 if (command === '$redeemkey') { const fs = require('fs') const haspath = `whitelisted/${message.author.id}.txt`; if (fs.existsSync(haspath)) return message.reply({ embeds: [ new MessageEmbed() .setColor('RED') .setDescription(`You're already whitelisted!`) ] }); fs.readFile('notredeemed.txt', function (err, data) { if (data.toString().match(new RegExp(`^${args[0]}$`, "m"))) { const match = new RegExp(`(\n|^)${args[0]}(\r|$)`) const newFile = data.toString().replace(match, '') fs.writeFile('notredeemed.txt', newFile, "utf8", function (err) { if (err) return console.log(err) console.log("true") }) } }) }

¡Gracias!

about 4 years ago · Juan Pablo Isaza
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!