Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

276
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda