diff --git a/README.md b/README.md index c9cb416..6c1923d 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,8 @@ settings = { }; const { Player } = require('discord-player'); -const player = new Player(client, "YOUTUBE API KEY", { - leaveOnEnd: true, - leaveOnStop: true -}); +// Create a new Player (Youtube API key is your Youtube Data v3 key) +const player = new Player(client, "YOUTUBE API KEY"); // To easily access the player client.player = player; @@ -59,6 +57,10 @@ client.on("ready", () => { client.login(settings.token); ``` +You can pass a third parameter when instantiating the class Player: the **options** object: +**options.leaveOnEnd**: whether the bot should leave the voice channel when there is no more song in the queue. +**options.leaveOnStop**: whether the bot should leave the voice channel when the `stop()` function is used. + ### Play To play a song, use the `client.manager.play()` function. diff --git a/docs/index.html b/docs/index.html index 0722ada..982b7e5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -48,14 +48,12 @@
-

Discord Music

-

downloadsBadge -versionBadge +

Discord Player

+

downloadsBadge +versionBadge patreonBadge

Note: this module uses recent discordjs features and requires discord.js version 12.

-

Discord Music is a powerful Node.js module that allows you to easily implement music commands. Everything is customizable, and everything is done to simplify your work without limiting you!

-

Installation

-
npm install --save discord-music
+
npm install --save discord-player
 
+

Install opusscript or node-opus:

+
npm install --save opusscript
+
+

Install FFMPEG and you're done!

Player

const Discord = require("discord.js"),
 client = new Discord.Client(),
@@ -86,11 +86,9 @@ settings = {
     token: "Your Discord Token"
 };
 
-const { Player } = require('discord-music');
-const player = new Player(client, "YOUTUBE API KEY", {
-    leaveOnEnd: true,
-    leaveOnStop: true
-});
+const { Player } = require('discord-player');
+// Create a new Player (Youtube API key is your Youtube Data v3 key)
+const player = new Player(client, "YOUTUBE API KEY");
 // To easily access the player
 client.player = player;
 
@@ -100,6 +98,9 @@ client.on("ready", () => {
 
 client.login(settings.token);
 
+

You can pass a third parameter when instantiating the class Player: the options object: +options.leaveOnEnd: whether the bot should leave the voice channel when there is no more song in the queue. +options.leaveOnStop: whether the bot should leave the voice channel when the stop() function is used.

Play

To play a song, use the client.manager.play() function.

Usage: