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

126
Views
Límite de Discord.js Webhooks 10 en el canal

Cada vez que un usuario envía mensajes, un webhook edita su nombre y muestra mensaje.autor.nombre de usuario, pero después de un tiempo, quizás debido a un error, el webhook crea 2 o más webhooks y sigue mostrando los nombres de los autores de los mensajes.

¿Cómo usar solo 1 webhook?

 let webhook = await client.channels.cache.get(smchannel[i]).fetchWebhooks(); webhook = webhook.find(x => x.name === message.member.nickname ? message.member.nickname : message.author.username); webhook = await client.channels.cache.get(smchannel[i]).createWebhook('Chat Guy', { avatar: client.user.displayAvatarURL({ dynamic: true })}); await webhook.edit({ name: message.member.nickname ? message.member.nickname : message.author.username, avatar: message.author.displayAvatarURL({ dynamic: true })}) webhook.send( content ).catch(err => { }) } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Siempre estás creando un nuevo webhook.

En primer lugar, no necesita encontrar un nombre exacto con el autor porque puede personalizar los webhooks antes de enviar un mensaje.

 let webhooks = await client.channels.cache.get(smchannel[i]).fetchWebhooks(); let webhook = webhooks.first() if(!webhook){ // create new webhook if not exists in channel } else { // edit your webhook in here and send! }
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!