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 and ESM.

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
FFmpeg 9 librariesOn the bot machineOn the server machine
Local streams from pluginsSupportedNot supported
Best forFirst bots, single-machine deploymentsScaling, isolating audio from the bot

Embedded playback

pnpm add @remedia/node

@remedia/node must be the exact version that your discord-player release depends on. The generator and the manual setup use 0.1.0, which matches discord-player@dev at the time of writing. Your package manager reports a peer dependency warning when the versions differ.

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.

Install the FFmpeg 9 shared libraries on the bot machine. An ffmpeg executable alone is not enough.

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. The audio server needs FFmpeg and the bot does not. See remote playback for server setup.

Continue reading

Create a music bot

On this page