Discord.js 13 channel.join is not a function

Discord.js no longer supports voice. You need to use the other package they made (@discordjs/voice). You can import joinVoiceChannel from there. //discord.js and client declaration const { joinVoiceChannel } = require(‘@discordjs/voice’); client.on(‘messageCreate’, message => { if(message.content === ‘!join’) { joinVoiceChannel({ channelId: message.member.voice.channel.id, guildId: message.guild.id, adapterCreator: message.guild.voiceAdapterCreator }) } })

Discord.js v12 code breaks when upgrading to v13

Discord.js v13 has a lot of changes, and those are only a few. Before updating to v13, you should change the following things //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 { … Read more

How can I migrate my code to Discord.js v12 from v11?

Here are some of the most common breaking changes introduced in Discord.js v12 that people run into. Managers Properties such as Client#users and Guild#roles are now managers, instead of the cached Collection of items. To access this collection, use the cache property: const user = client.users.cache.get(‘123456789012345678’) const role = message.guild.roles.cache.find(r => r.name === ‘Admin’) In … Read more

message event listener not working properly

In discord.js v13, it is necessary to specify an intent in new discord.Client(). Events other than the specified intent will not be received. ClientOptions Intents#FLAGS To receive the message event, you will need the GUILDS and GUILD_MESSAGES intents. You mean… const client = new Discord.Client({ partials: [‘MESSAGE’, ‘CHANNEL’, ‘REACTION’], intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] }); Or to … Read more

None of my discord.js guildmember events are emitting, my user caches are basically empty, and my functions are timing out?

🤖 Discord is now enforcing privileged intents What are intents? Maintaining a stateful application can be difficult when it comes to the amount of data you’re expected to process, especially at scale. Gateway Intents are a system to help you lower that computational burden. Gateway intents allow you to pick and choose what events you … Read more