Discord Player
Installation

Installation

Install Discord Player and choose where audio runs.

You are reading the v8 docsDev

Discord Player v8 requires Node.js 22.18 or newer. It ships as ES modules with no top-level await, so both import { Player } from 'discord-player' and const { Player } = require('discord-player') work.

Starting a new bot?

npm create music-bot@dev my-bot creates a project with everything on this page already installed and configured. See Getting started. Read on to add Discord Player to an existing project.

pnpm add discord-player@dev

v8 is a preview release, so install it with the dev tag. Without a tag, your package manager installs v7.

You also need a Discord gateway library such as discord.js. Discord Player does not open the gateway connection itself.

Choose where audio runs

EmbeddedRemote
Audio engineInside your bot processA separate remedia-server
Extra package on the bot@remedia/nodeNone
Local streams from pluginsSupportedNot supported
Best forFirst bots, single-machine deploymentsScaling, isolating audio from the bot

Embedded playback

pnpm add @remedia/node
import { Player } from 'discord-player';

const player = new Player({
  nodes: [{ id: 'local', type: 'embedded' }],
  send,
});

nodes can be omitted. A Player without nodes uses one embedded node named local.

The official @remedia/node addon bundles FFmpeg 9 through static linking. No separate FFmpeg installation or library-path configuration is needed. Allow optional dependencies so the native addon for your OS and CPU architecture is installed.

Remote playback

import { Player } from 'discord-player';

const player = new Player({
  nodes: [
    {
      id: 'audio-1',
      type: 'remote',
      url: 'wss://audio.example.com/v1/ws',
      auth: { username: 'bot', password: process.env.REMEDIA_PASSWORD! },
    },
  ],
  send,
});

send is the gateway callback from the manual setup tutorial. Official server releases also bundle FFmpeg 9. A remote-only bot does not need @remedia/node. See remote playback for server setup.

Continue reading

Create a music bot

On this page