Estoy buscando cómo enviar un mensaje a un canal específico. Vi a algunas personas usar client.channels.cache.get('channelidhere').send('text') sin embargo, todo eso es un error para mí. Aquí está mi código completo. trabajando en un bot de boletos para un amigo no es nada loco.
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```Para cualquiera que todavía esté buscando una respuesta, aquí está.
Para mensajes regulares hacer
message.guild.channels.cache.get('channel-id').send('message')Para las interacciones hacer
interaction.guild.channels.cache.get('channel-id').send('message')