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

134
Visualizações
Discord.JS Message in a specific Channel

So i'm new to the whole Discord.JS thing and i am trying to figure out how to get the bot to write a message to the General Chat when a new person joins.

I have seen a lot of people doing it like this:

const channel = client.channels.cache.find(channel => channel.name === channelName)
channel.send(message)

But this isnt working for me. Whenever i am trying to send a message with the channel.send(message) it gives me a error message.

I have also tried the version where you do it with the client.channels.cache.get(<Channel-ID>)

But this also didnt work for me.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use this code similar to the post: how to send a message to specific channel Discord.js

<client>.channels.fetch('<id>').then(channel => channel.send('<content>'))

Example

client.channels.fetch('922880975074127872')
.then(channel => channel.send(`Welcome, ${user}`))
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