Skip to main content
Back to Blog
TutorialJanuary 10, 20258 min read

Migrating to Discord.js v14: Complete Tutorial

Discord.js v14 brings major changes. Here's everything you need to know to migrate your bot successfully.

Marcus Johnson

Marcus Johnson

Bot Developer

Migrating to Discord.js v14: Complete Tutorial

Migrating to Discord.js v14: Complete Tutorial

Discord.js v14 introduced significant breaking changes. This guide will help you upgrade smoothly.

Major Changes

Intents are Required

You must now explicitly declare which intents your bot needs:

javascript
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent
  ]
});

Slash Commands are Default

Prefix commands should be replaced with slash commands for better UX:

javascript
const { SlashCommandBuilder } = require('discord.js');

const command = new SlashCommandBuilder()
  .setName('ping')
  .setDescription('Check bot latency');

Builders Pattern

Many objects now use a builder pattern:

javascript
const { EmbedBuilder } = require('discord.js');

const embed = new EmbedBuilder()
  .setTitle('Hello!')
  .setColor(0x0099FF);

Migration Checklist

  1. Update your package.json to discord.js v14
  2. Replace all deprecated methods
  3. Add required intents
  4. Convert prefix commands to slash commands
  5. Update embed syntax
  6. Test thoroughly

Deploying on NexusHost

Once migrated, deploy to NexusHost:

  1. Push changes to GitHub
  2. NexusHost auto-detects Node.js
  3. Your bot restarts with the new version

Conclusion

While v14 requires significant changes, the improvements in performance and developer experience are worth it.

Related Articles