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

253
Views
Javascript ~ How to send a message in a specific channel discord.js v13

As you know recently discord.js has moved to v13. I try to send a message in a specific channel but it gives me an error. Here's my code:

let channel = client.channels.cache.get(CHANNEL_ID)
channel.send(`${MSG}`)

This is my error:

TypeError: Cannot read property 'send' of undefined

Please help me. I've tried finding similar topics here and the only solution I found was in typescript but I want it in javascript.

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Using client.guilds.cache.get("ID").channels.cache.get("ID").send() should help!

about 4 years ago · Juan Pablo Isaza Report

0

You could also use:

let channel = GUILD.channels.cache.get(CHANNEL_ID);
channel.send(MSG);
about 4 years ago · Juan Pablo Isaza Report

0

discord.js v13 needs you to specify which events you want your bot to receive. To achieve this you need to select, so called "Gateway Intents".

Here is a guide on Gateway Intents and how you configure them.
Here is a list of all Intents and what events they allow your bot to receive.

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!