Soy bastante nuevo en javascript o discord.js, pero supongo que fue algo como esto:
client.on('channelCreate', channel => { message.channel.send('test'); })Supongo que 'channelCreate' no existe.
Tu conjetura es correcta.
De acuerdo con la documentación de discord.js , puede escuchar un evento channelCreate para activar algo cuando se crea un canal.
Para saber quién creó un canal, su bot necesita acceder a los registros de auditoría y la primera entrada del mismo.
client.on("channelCreate", async (channel) => { if (!channel.guild) return; // Fetch the audit logs of CHANNEL_CREATE events. const audit_logs = await channel.guild.fetchAuditLogs({ limit: 1, type: "CHANNEL_CREATE" }); if (!audit_logs.entries.first()) { console.error("No entry found."); return; } const entry = audit_logs.entries.first(); const executor = entry.executor; // The executor property is type User, // so you can easily check if it's a bot by doing... const is_bot = executor.bot; // `is_bot` will be boolean. });