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

278
Visualizações
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 Respostas
Responde à pergunta

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 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