discord-player 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,7 @@ It provides easy set of customizable tools to develop Discord Music bots.
11
11
 
12
12
  - Beginner friendly, easy to understand
13
13
  - TypeScript support
14
+ - Supports audio player sharing
14
15
  - Quick and easy to set up
15
16
  - Wide range of player management features
16
17
  - 64+ built-in audio filter presets
@@ -23,7 +24,7 @@ It provides easy set of customizable tools to develop Discord Music bots.
23
24
 
24
25
  ## Installation
25
26
 
26
- ## Before you start
27
+ ### Before you start
27
28
 
28
29
  Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a compatible version using `npm list discord.js` in your terminal. If you're using an earlier version please update it. The [Discord.JS Guide](https://discordjs.guide/) has resources to help with that.
29
30
 
@@ -42,18 +43,25 @@ Discord Player is a high level framework for Discord VoIP. Discord only accepts
42
43
 
43
44
  ```bash
44
45
  $ yarn add @discordjs/opus
46
+ # or
45
47
  $ yarn add opusscript
46
48
  ```
47
49
 
48
50
  #### FFmpeg or Avconv
49
51
 
50
- FFmpeg or Avconv is required for media transcoding. You can get it from [https://ffmpeg.org](https://www.ffmpeg.org/download.html) or by installing it from npm:
52
+ FFmpeg or Avconv is required for media transcoding. You can get it from [https://ffmpeg.org](https://www.ffmpeg.org/download.html) or by installing it from npm (ffmpeg-static or other binaries are not recommended):
51
53
 
52
54
  ```bash
53
55
  $ yarn add ffmpeg-static
56
+ # or
57
+ $ yarn add @ffmpeg-installer/ffmpeg
58
+ # or
59
+ $ yarn add @node-ffmpeg/node-ffmpeg-installer
60
+ # or
61
+ $ yarn add ffmpeg-binaries
54
62
  ```
55
63
 
56
- You can get avconv from [https://libav.org/download](https://libav.org/download).
64
+ > Use `FFMPEG_PATH` environment variable to load ffmpeg from custom path.
57
65
 
58
66
  #### Streaming Library
59
67
 
@@ -61,7 +69,9 @@ You also need to install streaming library if you want to add support for youtub
61
69
 
62
70
  ```bash
63
71
  $ yarn add ytdl-core
72
+ # or
64
73
  $ yarn add play-dl
74
+ # or
65
75
  $ yarn add @distube/ytdl-core
66
76
  ```
67
77
 
@@ -73,13 +83,25 @@ Let's create a master player instance.
73
83
 
74
84
  ```js
75
85
  const { Player } = require('discord-player');
86
+
87
+ // get some extractors if you want to handpick sources
88
+ const { SpotifyExtractor, SoundCloudExtractor } = require('@discord-player/extractor');
89
+
76
90
  const client = new Discord.Client({
77
91
  // Make sure you have 'GuildVoiceStates' intent enabled
78
92
  intents: ['GuildVoiceStates' /* Other intents */]
79
93
  });
80
94
 
95
+
81
96
  // this is the entrypoint for discord-player based application
82
97
  const player = new Player(client);
98
+
99
+ // This method will load all the extractors from the @discord-player/extractor package
100
+ await player.extractors.loadDefault();
101
+
102
+ // If you dont want to use all of the extractors and register only the required ones manually, use
103
+ await player.extractors.register(SpotifyExtractor, {});
104
+ await player.extractors.register(SoundCloudExtractor, {});
83
105
  ```
84
106
 
85
107
  > **Did You Know?** _Discord Player is by default a singleton._
@@ -128,4 +150,4 @@ That's all it takes to build your own music bot.
128
150
  ## Community Resources
129
151
 
130
152
  A curated list of resources (such as open source music bots, extractors, etc.) built by Discord Player community.
131
- [https://discord-player.js.org/docs/guides/community-resources](https://discord-player.js.org/docs/guides/community-resources)
153
+ [https://discord-player.js.org/docs/guides/community-resources](https://discord-player.js.org/docs/guides/community-resources)