me sale este error:
Client.on("guildCreate", (guild) => { TypeError: Client.on is not a functionmi código es:
const client = require("../index"); const { MessageEmbed } = require("discord.js"); client.on("guildCreate", (guild) => { let channelToSend; guild.channels.cache.forEach((channel) => { if ( channel.type === "text" && !channelToSend && channel.permissionsFor(guild.me).has("SEND_MESSAGES") ) channelToSend = channel; }); if(!channelToSend) return; channelToSend.send( new MessageEmbed() .setAuthor(guild.name, guild.iconURL({ dynamic: true })) .setDescription("Thanks for inviting me my prefix is '?'") .setColor("RANDOM") .setTimestamp() ) });No estás creando el client correctamente.
La documentación oficial dice que haga eso para crear el client :
const { Client } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS] });