Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Discord.js Webhooks 10 limit on channel

Every time a user send messages a webhook edits its name and shows message.author.username but after After some time maybe because of an error the webhook creates 2 or more webhooks and keeps showing message author names.

How to use only 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 Respostas
Responde à pergunta

0

You are always creating a new webhook.

First of all, you don't need to find an exact name with author because you can customize webhooks before you sent a message.

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda