Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-play

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-play

The ultimate framework based on play-dl to create music bots in discord.js v13 and also interact with the new voice module in a robust manner.

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

GITHUB DISCORD

discord-play (DisPlay) - Beta Project

A powerful module backed by play-dl to create music bots easily and also interact with the new voice module for discord.js v13 in a more robust manner.

Features

  • A flexible discord.js module to make music bots without any API key using play-dl
  • Supports YouTube and Spotify (only at the moment)
  • Premade AudioPlayer and VoiceConnection event-based logic modules to simplify interacting with the new @discordjs/voice module
  • 100% promise based
  • 100% event logic based

Installation

NPM

Pre-requisites

The following are some required npm packages to be installed (alternatives provided) :

  • discord.js v13+ only
  • The new voice library - @discordjs/voice
  • Opus encoding library - @discordjs/opus or opusscript
  • FFmpeg - ffmpeg-static or ffmpeg installed globally in your system
  • Encrytion package - sodium or libsodium-wrappers
  • The data fetching module - play-dl

Basic Usage

// ES6 JS or TS
import { DiscordPlay, DisPlayEvent } from 'discord-play';

//Common JS
const { DiscordPlay, DisPlayEvent } = require('discord-play');

The main DiscordPlay module is currently work in progress but the separate modules are available for use.

Implementing the separate modules in your project

DisPlayConnection and DisPlayPlayer are two complete premade event-driven modules available inside DiscordPlay. You can include them in your project separately according to your need.

The full documentation for these two modules are available here.

import {
    DisPlayConnection, DisPlayPlayer, DisPlayEvent
} from 'discord-play';

// joins the voice channel and attaches all connection logic
const connection = new DisPlayConnection(message.member.voice);
// attaches the premade audio player to the connection created
const player = new DisPlayPlayer(message.guild.id);

// sample connection event
connection.on(DisPlayEvent.VOICE_JOIN, (voiceId) => {
	message.reply("Joined the voice channel.");
});

// sample player event
player.on(DisPlayEvent.PLAYING, () => {
    message.channel.send("Now playing.");
});

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc