Star ✨ on GitHub

Prerequisites

What you need before writing code (Discord, Node.js, and an audio node).

Before you touch any code, make sure the "plumbing" is ready. Most Moonlink problems are not code problems — they’re usually missing intents, a wrong password, or a node that isn’t reachable.

Requirements

  • Node.js: v18.x or higher.
  • discord.js: v14.
  • An audio server:
    • NodeLink (recommended), or
    • Lavalink v4.

Discord Developer Portal checklist

  1. Create an application.
  2. Create/enable the bot.
  3. Copy the token (treat it like a password).
  4. Invite the bot to your server.

Required intents

For a prefix-command music bot, you usually want:

  • Guilds (required)
  • GuildVoiceStates (required for voice)
  • GuildMessages + MessageContent (for reading !play style commands)

Before blaming the bot, verify:

  • The node is running.
  • Host/port/password are correct.
  • If you use TLS, set secure: true.