Al actualizar mi discord.js a v13, recibo muchos errores:
//member.hasPermission is not a function member.hasPermission("SEND_MESSAGES") //Cannot send an empty message channel.send(someEmbed) //Cannot send an empty message channel.send({embed: someEmbed}) //Warning: The 'message' event was deprecated, use 'messageCreate' instead client.on("message", msg => {}) //Cannot send an empty message channel.send(user) //[CLIENT_MISSING_INTENTS] Valid intents must be provided for the client const client = new Client() //channel.join is not a function await channel.join()Estos no suceden en v12, entonces, ¿cómo los soluciono en v13?
Discord.js v13 tiene muchos cambios, y esos son solo algunos. Antes de actualizar a v13, debe cambiar las siguientes cosas
//member.hasPermission("SEND_MESSAGES") member.permissions.has("SEND_MESSAGES") //channel.send(someEmbed) / channel.send({embed: someEmbed}) channel.send({ embeds: [someEmbed] }) //make sure it's an array! //client.on("message", msg => {}) client.on("messageCreate", msg => {}) //channel.send(user) channel.send(user.toString()) //const client = new Client() const { Intents, Client } = require("discord.js") const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}) //more intents may be provided //await channel.join() const { joinVoiceChannel } = require("@discordjs/voice") //requires installation joinVoiceChannel({ channelId: channel.id, guildId: guild.id, adapterCreator: guild.voiceAdapterCreator })Hay algunos cambios más. Puedes verlos en la guía.