discord-play (DisPlay)
A robust wrapper module for @discordjs/voice, implementing functions and emitting events making it easier to interact with the new voice module.
Features
Documentation
For any help, feel free to join the discord server and ask.
Installation
Pre-requisites
The following are some required npm packages to be installed (alternatives provided) :
discord.js
v13+- The new voice library -
@discordjs/voice
(Gets automatically installed as dependency) - Opus encoding library -
@discordjs/opus
or opusscript
- FFmpeg -
ffmpeg-static
or ffmpeg installed globally in your system - Encrytion package -
sodium
or libsodium-wrappers
Importing
import { DiscordPlay, DisPlayEvent } from 'discord-play';
const { DiscordPlay, DisPlayEvent } = require('discord-play');
Basic Usage
import { DisPlayConnection, DisPlayPlayer, DisPlayEvent } from 'discord-play';
const connection = new DisPlayConnection(message.member.voice);
const player = new DisPlayPlayer(message.guild.id);
connection.on(DisPlayEvent.VOICE_JOIN, (voiceId) => {
message.reply("Joined the voice channel.");
});
player.on(DisPlayEvent.PLAYING, () => {
message.channel.send("Now playing.");
});
License
This repository uses MIT license.