discord-player 6.6.0-dev → 6.6.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
@@ -1,87 +1,89 @@
1
1
  # Discord Player
2
2
 
3
- Discord Player is a powerful framework for JavaScript and TypeScript, built on top of **[@discordjs/voice](https://npm.im/@discordjs/voice)** library.
4
- It provides easy set of customizable tools to develop Discord Music bots.
3
+ Discord Player is a robust framework for developing Discord Music bots using JavaScript and TypeScript. It is built on top of the [@discordjs/voice](https://npm.im/@discordjs/voice) library and offers a comprehensive set of customizable tools, making it one of the most feature enrich framework in town.
5
4
 
6
5
  [![downloadsBadge](https://img.shields.io/npm/dt/discord-player?style=for-the-badge)](https://npmjs.com/discord-player)
7
6
  [![versionBadge](https://img.shields.io/npm/v/discord-player?style=for-the-badge)](https://npmjs.com/discord-player)
8
7
  [![discordBadge](https://img.shields.io/discord/558328638911545423?style=for-the-badge&color=7289da)](https://androz2091.fr/discord)
9
8
 
10
- # Why Discord Player?
9
+ # Why Choose Discord Player?
11
10
 
12
- - Beginner friendly, easy to understand
11
+ - Beginner-friendly with easy-to-understand features
13
12
  - TypeScript support
13
+ - Offers hackable APIs.
14
14
  - Supports audio player sharing
15
- - Quick and easy to set up
15
+ - Quick and easy setup process
16
16
  - Wide range of player management features
17
- - 64+ built-in audio filter presets
18
- - Highly customizable
17
+ - Offers 64+ built-in audio filter presets
18
+ - Highly customizable according to your needs
19
19
  - Automatic queue management
20
20
  - Query caching support
21
- - Wide range of extendable sources via Extractors API
22
- - Object oriented
23
- - Built in stats tracker
21
+ - Extensible sources through the Extractors API
22
+ - Object-oriented design
23
+ - Built-in stats tracker
24
+ - Offers easy debugging methods
25
+ - Out-of-the-box voice states handling
24
26
 
25
27
  ## Installation
26
28
 
27
29
  ### Before you start
28
30
 
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.
31
+ Discord Player requires Discord.js 14.0 or higher. Please ensure that you have a compatible version by running `npm list discord.js` in your terminal. If you're using an earlier version, please update it. The [discord.js Guide](https://discordjs.guide) provides resources to assist you with the update process.
30
32
 
31
33
  #### Main Library
32
34
 
33
35
  ```bash
34
- $ yarn add discord-player # main library
35
- $ yarn add @discord-player/extractor # extractors provider
36
+ $ npm install --save discord-player # main library
37
+ $ npm install --save @discord-player/extractor # extractors provider
36
38
  ```
37
39
 
38
- > Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
40
+ > Discord Player recognizes `@discord-player/extractor` and loads it automatically by default. Just invoke `await player.extractors.loadDefault()`.
39
41
 
40
42
  #### Opus Library
41
43
 
42
- Discord Player is a high level framework for Discord VoIP. Discord only accepts opus packets, thus you need to install opus library. You can install any of these:
44
+ Since Discord only accepts opus packets, you need to install the opus library. Choose one of the following options:
43
45
 
44
46
  ```bash
45
- $ yarn add @discordjs/opus
47
+ $ npm install --save @discordjs/opus
46
48
  # or
47
- $ yarn add opusscript
49
+ $ npm install --save opusscript
48
50
  ```
49
51
 
50
52
  #### FFmpeg or Avconv
51
53
 
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):
54
+ FFmpeg or Avconv is required for media transcoding. You can obtain it from [https://ffmpeg.org](https://ffmpeg.org) or install it via npm (we recommend against using ffmpeg-static or other binaries):
53
55
 
54
56
  ```bash
55
- $ yarn add ffmpeg-static
57
+ $ npm install --save ffmpeg-static
56
58
  # or
57
- $ yarn add @ffmpeg-installer/ffmpeg
59
+ $ npm install --save @ffmpeg-installer/ffmpeg
58
60
  # or
59
- $ yarn add @node-ffmpeg/node-ffmpeg-installer
61
+ $ npm install --save @node-ffmpeg/node-ffmpeg-installer
60
62
  # or
61
- $ yarn add ffmpeg-binaries
63
+ $ npm install --save ffmpeg-binaries
62
64
  ```
63
65
 
64
66
  > Use `FFMPEG_PATH` environment variable to load ffmpeg from custom path.
65
67
 
66
68
  #### Streaming Library
67
69
 
68
- You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:
70
+ If you want to add support for YouTube playback, you need to install a streaming library. Choose one of the following options:
69
71
 
70
72
  ```bash
71
- $ yarn add ytdl-core
73
+ $ npm install --save ytdl-core
72
74
  # or
73
- $ yarn add play-dl
75
+ $ npm install --save play-dl
74
76
  # or
75
- $ yarn add @distube/ytdl-core
77
+ $ npm install --save @distube/ytdl-core
76
78
  # or
77
- $ yarn add yt-stream
79
+ $ npm install --save yt-stream
78
80
  ```
79
81
 
80
- Done with all these? Let's write a simple music bot then.
82
+ Once you have completed these installations, let's proceed with writing a simple music bot.
81
83
 
82
84
  ### Setup
83
85
 
84
- Let's create a master player instance.
86
+ Let's create a main player instance. This instance handles and keeps track of all the queues and its components.
85
87
 
86
88
  ```js
87
89
  const { Player } = require('discord-player');
@@ -94,7 +96,6 @@ const client = new Discord.Client({
94
96
  intents: ['GuildVoiceStates' /* Other intents */]
95
97
  });
96
98
 
97
-
98
99
  // this is the entrypoint for discord-player based application
99
100
  const player = new Player(client);
100
101
 
@@ -106,9 +107,7 @@ await player.extractors.register(SpotifyExtractor, {});
106
107
  await player.extractors.register(SoundCloudExtractor, {});
107
108
  ```
108
109
 
109
- > **Did You Know?** _Discord Player is by default a singleton._
110
-
111
- Now, let's add some event listeners:
110
+ Discord Player is mostly events based. It emits different events based on the context and actions. Let's add a basic event listener to notify the user when a track starts to play:
112
111
 
113
112
  ```js
114
113
  // this event is emitted whenever discord-player starts to play a track
@@ -118,7 +117,7 @@ player.events.on('playerStart', (queue, track) => {
118
117
  });
119
118
  ```
120
119
 
121
- Let's write the command part. You can define the command as you desire. We will only check the command handler part:
120
+ Let's move on to the command part. You can define the command as per your requirements. We will only focus on the command handler part:
122
121
 
123
122
  ```js
124
123
  async function execute(interaction) {
@@ -145,11 +144,8 @@ async function execute(interaction) {
145
144
  }
146
145
  ```
147
146
 
148
- That's all it takes to build your own music bot.
149
-
150
- #### Check out the [Documentation](https://discord-player.js.org) for more info.
147
+ That's all it takes to build your own music bot. Please check out the [Documentation](https://discord-player.js.org) for more features/functionalities.
151
148
 
152
149
  ## Community Resources
153
150
 
154
- A curated list of resources (such as open source music bots, extractors, etc.) built by Discord Player community.
155
- [https://discord-player.js.org/docs/guides/community-resources](https://discord-player.js.org/docs/guides/community-resources)
151
+ Explore a curated list of resources built by the Discord Player community, including open-source music bots and extractors. Visit [https://discord-player.js.org/showcase](https://discord-player.js.org/showcase) for more information.