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

109
Views
Intentando redirigir mensajes de un canal a otro

Recibo este error en el siguiente código:

(nodo: 13760) UnhandledPromiseRejectionWarning: TypeError: No se puede leer la propiedad 'enviar' de undefined

 bot.on('message', async (message) => { message .delete({ timeout: 10 }) .catch((err) => logger.error(`Could not delete message (Error: ${err.message})`), ); // Checking if command was executed in report channel if (message.channel.name != 'from-user') { // Do nothing logger.info( `message has not been sent in the forwarding channel! Aborting request.`, ); } else { if (message.author.bot) return; await client.channels.cache.get('910109122572218378').send(message.content); console.log(message.content); // log messages return; } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si la ID del canal es correcta, es probable que el canal no esté en caché. Si conoce la ID del canal, puede fetch el canal por esta ID. Si está en caché, devuelve el canal en caché:

 const channel = await client.channels.fetch(CHANNEL_ID) await channel.send(message.content) console.log(message.content) // log messages

fetch() devuelve una Promesa, por lo que deberá usar await .

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!