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

269
Views
Send a message to a specific channel with discord bot

I am looking on how to send a message to a specific channel. I saw some people to use client.channels.cache.get('channelidhere').send('text') however that whole thing is an error for me. Here is my whole code. working on a ticket bot for a friend not anything crazy.

import { ICommand } from "wokcommands";

export default {
    category: 'Utility',
    description: 'Makes a support ticket.',
    slash: false,
    testOnly: true,

    callback: async({ message, args, client, guild, member }) => {
        let number = 0
        let timeout = 200
        const channel = await message.guild?.channels.create('Ticket', {
            permissionOverwrites: [
                {
                    id: message.author,
                    allow: ['VIEW_CHANNEL', 'READ_MESSAGE_HISTORY'],
                }
            ],
        })
        channel?.setParent('956314466201514064')
        console.log(channel?.id)
        let setID = channel?.id
        
        client.channels.cache.get('956314466201514064').send('')
        

        
        
        
    }
} as ICommand```
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For anyone still looking for an answer here it is.

For regular messages do

message.guild.channels.cache.get('channel-id').send('message')

For interactions do

interaction.guild.channels.cache.get('channel-id').send('message')
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!