Socket
Book a DemoInstallSign in
Socket

doyle-music

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

doyle-music

A simple module to allow any discord bot using discord.js v12.0.0 to have music

1.1.2
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Doyle Music - A simple module

This module would allow any discord.js bot running on v12.0.0 (master) to have musical functionally.

Example

const api = require("doyle-music");
const Discord = require("discord.js");
const client = new Discord.Client();

client.login("TOKEN");

new api(client, "YT API KEY", { prefix: "-", anyoneCanSkip: true, autoHandle: true, autoLeaveTime: 30000 });

If you wish to use this module by handling the commands yourself, we change the autoHandle option to false, here is an example:

const api = require("doyle-music");
const Discord = require("discord.js");
const client = new Discord.Client();
const prefix = "!";

client.login("TOKEN");

const music = new api(client, "YT API KEY", { prefix: "-", anyoneCanSkip: true, autoHandle: false, autoLeaveTime: 30000 });

client.on("message", message => {
  let args = message.content.split(" ");
  const command = args[0].slice(prefix.length);
  args = args.join(" ").slice(command.length + this.prefix.length).trim().split(" ");
  
  if (command === "play") {
      music.play(client, message, args);
  }
})

That's all you need to do to get started, but make sure you have ffmpeg and node-opus installed, simply running npm i node-opus ffmpeg-binaries will do it!

Avaiable Options:

optionstypedescription
prefixStringThe prefix the music bot should use.
anyoneCanSkipBooleanWhether or not anyone can skip, if set to false, only Administrators can skip.
autoHandleBooleanWhether or not the client handles everything for you, if set to false, you can handle commands yourself using the functions documented.
autoLeaveTimeNumberHow long to wait untill the client leaves the voice channel automatically if no one is in the call, in milliseconds. Default: 30 seconds.

Available commands:

loop | loops the current playing stream

np | displays the current song in the music queue

pause | pauses the current playing stream

play | plays a song or adds it to the queue if there is one.

queue | displays the music queue.

remove | removes a certain song from the queue

resume | resumes the current playing stream

search | search youtube for a video to play

skip | skips the current playing stream

stop | stops the current playing stream

volume | sets the volume of the stream

FAQs

Package last updated on 19 Mar 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.