const Discord = require("discord.js"); const Bot = new Discord.Client({Intents:[Discord.Intents.FLAGS.GUILD_MEMBERS, Discord.Intents.FLAGS.GUILDS]}) Bot.on('ready', () => { console.log("The bot is online") let commands = Bot.application.commands; commands.create({ name: "hello" , description: "reply hello to the user", options: [ { name: "person", description: "The user you want to say hello to", require: true, type: Discord.Constants.ApplicationCommandOptionTypes.USER } ] }) }) Bot.on('interactionCreate', interaction => { if(!interaction.isCommand()) return; let name = interaction.commandName let options = interaction.options; if(name == "hello") { interaction.reply({ content: "Hello", ephemeral: false }) } if(name == "sayhello"){ let user = options.getUser('person'); interaction.reply({ content: 'Hello ${user.username} }) } }) bot.login("token")Desde discord.js v13, debe proporcionar Intents al declarar el cliente. Fueron presentados por Discord para que los desarrolladores puedan elegir qué tipo de datos necesitará recibir el bot. Todo lo que tiene que hacer es agregar intenciones al declarar el cliente. El código podría ser algo como esto:
const { Client } = require('discord.js') const client = new Client({ intents: [ Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES ] })Y también, como lo señaló @Richie Bendall, ha escrito en mayúscula la I al declarar las intenciones. Puede obtener más información sobre los intentos aquí => Gateway Intents | Discord.js
La intents es la opción en minúsculas, no en mayúsculas. Consulte ClientOptions .
Bueno, en realidad, desde la nueva actualización de discord.js, debe proporcionar las intenciones al bot. esto podría ayudar
const { Client, Intents } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });