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

210
Views
Problema con el bot de discordia javascript que involucra el envío de mensajes vacíos

Estoy creando un bot de discordia y estoy tratando de guardar cadenas en una matriz y enviarla si se envía el comando correcto. Aquí está el código:

 client.on('messageCreate', (msg) => { if(!msg.content.startsWith(commandChar)) return; const args = msg.content.slice(1).split(' '); const cmdBody = msg.content.slice(msg.content.indexOf(' ')); const cmd = args.shift().toLowerCase(); switch(cmd) { case 'new': quotes.push(cmdBody); msg.channel.send('Quote added! The Quote Number is ' + quotes.length); break; case 'find': if(isNaN(cmdBody)) cmdBody--; try { text = quotes[cmdBody] msg.channel.send(text); } catch { msg.channel.send('There is no quote corresponding to the number' + (cmdBody + 1) + '.'); } break; case 'changeCommandChar': if(cmdBody.length === 1) { commandChar = cmdBody; msg.channel.send('Command Character changed! The new command Character is ' + commandChar); } break; }

});

Aquí está el error:

RequestHandler.js: 350 lanzar nuevo DiscordAPIError (datos, res.status, solicitud);

DiscordAPIError: No se puede enviar un mensaje vacío

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!