Traté de ejecutar el nodo index.js en la terminal pero apareció este error: TypeError: No se pueden leer las propiedades de undefined (leyendo 'Guilds'). El siguiente es mi código:
const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [GatewayIntentBits.Guilds] }); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on('interactionCreate', async (interaction) => { if (!interaction.isCommand()) return; if (interaction.commandName === '!help') { await interaction.reply('I dont want to haelp u'); } }); client.login('OTQ0NjQyMDQ3MTI0NTgyNTEw.YhEkdg.e2AspV6x5JtTqKkq24DkeMmDlSo');Tal vez haya un problema con el Intent. Como no ha proporcionado la salida de error, le sugiero que use
const {Client, Intents, Collection} = require('discord.js') const client = new Client({intents:[Intents.FLAGS.GUILDS,Intents.FLAGS.GUILD_MESSAGES]})Reemplace este código con sus dos primeras líneas de código, que es:
const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [GatewayIntentBits.Guilds] });Y, por favor, nunca comparta el token de bot. Es como las credenciales de inicio de sesión para su bot. Por favor reinícialo en tu consola de desarrollador de Discord.