Skip to content

Commit

Permalink
Merge pull request #1712 from Androz2091/use-yarn-examples
Browse files Browse the repository at this point in the history
docs: use yarn in installation examples
  • Loading branch information
twlite authored Apr 13, 2023
2 parents b17e5a8 + fae4dea commit bd4e49d
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 83 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a c
#### Main Library

```bash
$ npm install discord-player # main library
$ npm install @discord-player/extractor # extractors provider
$ yarn add discord-player # main library
$ yarn add @discord-player/extractor # extractors provider
```

> Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
Expand All @@ -41,16 +41,17 @@ $ npm install @discord-player/extractor # extractors provider
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:

```bash
$ npm install @discordjs/opus
$ npm install opusscript
$ yarn add @discordjs/opus
# or
$ yarn add opusscript
```

#### FFmpeg or Avconv

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 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 is not recommended):

```bash
$ npm install ffmpeg-static
$ yarn add ffmpeg-static
```

You can get avconv from [https://libav.org/download](https://libav.org/download).
Expand All @@ -60,9 +61,11 @@ You can get avconv from [https://libav.org/download](https://libav.org/download)
You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:

```bash
$ npm install ytdl-core
$ npm install play-dl
$ npm install @distube/ytdl-core
$ yarn add ytdl-core
# or
$ yarn add play-dl
# or
$ yarn add @distube/ytdl-core
```

Done with all these? Let's write a simple music bot then.
Expand Down Expand Up @@ -128,4 +131,4 @@ That's all it takes to build your own music bot.
## Community Resources

A curated list of resources (such as open source music bots, extractors, etc.) built by Discord Player community.
[https://discord-player.js.org/docs/guides/community-resources](https://discord-player.js.org/docs/guides/community-resources)
[https://discord-player.js.org/docs/guides/community-resources](https://discord-player.js.org/docs/guides/community-resources)
51 changes: 26 additions & 25 deletions apps/website/components/pages/Home/Installation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ import { NPMIcon, PNPMIcon, YarnIcon } from "../../icons";

export function Installation() {
return (
<div>
<Title>Installation</Title>
<Prism.Tabs defaultValue="yarn">
<Prism.TabsList>
<Prism.Tab value="yarn" icon={<YarnIcon />}>
yarn
</Prism.Tab>
<Prism.Tab value="npm" icon={<NPMIcon />}>
npm
</Prism.Tab>
<Prism.Tab value="pnpm" icon={<PNPMIcon />}>
pnpm
</Prism.Tab>
</Prism.TabsList>
<div>
<Title>Installation</Title>
<Prism.Tabs defaultValue="yarn">
<Prism.TabsList>
<Prism.Tab value="yarn" icon={<YarnIcon />}>
yarn
</Prism.Tab>
<Prism.Tab value="pnpm" icon={<PNPMIcon />}>
pnpm
</Prism.Tab>
<Prism.Tab value="npm" icon={<NPMIcon />}>
npm
</Prism.Tab>
</Prism.TabsList>

<Prism.Panel language="bash" value="yarn">
yarn add discord-player play-dl @discordjs/opus
</Prism.Panel>
<Prism.Panel language="bash" value="npm">
npm install discord-player play-dl @discordjs/opus
</Prism.Panel>
<Prism.Panel language="bash" value="pnpm">
pnpm add discord-player play-dl @discordjs/opus
</Prism.Panel>
</Prism.Tabs>
</div>
<Prism.Panel language="bash" value="yarn">
yarn add discord-player @discord-player/extractor ytdl-core @discordjs/opus
</Prism.Panel>

<Prism.Panel language="bash" value="pnpm">
pnpm add discord-player @discord-player/extractor ytdl-core @discordjs/opus
</Prism.Panel>
<Prism.Panel language="bash" value="npm">
npm install discord-player @discord-player/extractor ytdl-core @discordjs/opus
</Prism.Panel>
</Prism.Tabs>
</div>
);
}
8 changes: 4 additions & 4 deletions apps/website/pages/docs/guides/common-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Install opus encoder.

```sh
$ npm install @discordjs/opus
$ yarn add @discordjs/opus
# or
$ npm install opusscript
$ yarn add opusscript
# or
$ npm install node-opus
$ yarn add node-opus
```

# FFmpeg/Avconv not found
Expand All @@ -26,6 +26,6 @@ Make sure you have `FFmpeg` or `Avconv` available on your system.

- If you are getting weird errors like something is not a constructor or version.split is not a function or something similar, please try the following:

Remove `node_modules`, `package-lock.json` or any lockfiles you have, run `npm cache clean --force` or similar command equivalent to your package manager and then run `npm install` (or the install command of your package manager)
Remove `node_modules`, `package-lock.json` or any lockfiles you have, run `npm cache clean --force` or similar command equivalent to your package manager and then run `yarn add` (or the install command of your package manager)

- If you are unable to solve the problem, please join our official support server 👉 [https://androz2091.fr/discord](https://androz2091.fr/discord)
16 changes: 8 additions & 8 deletions apps/website/pages/docs/guides/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a c
#### Main Library

```bash
$ npm install discord-player # main library
$ npm install @discord-player/extractor # extractors provider
$ yarn add discord-player # main library
$ yarn add @discord-player/extractor # extractors provider
```

> Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
Expand All @@ -24,8 +24,8 @@ $ npm install @discord-player/extractor # extractors provider
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:

```bash
$ npm install @discordjs/opus
$ npm install opusscript
$ yarn add @discordjs/opus
$ yarn add opusscript
```

#### FFmpeg / Avconv
Expand All @@ -35,7 +35,7 @@ FFmpeg or Avconv is required for media transcoding.
You can get FFmpeg from [ffmpeg.org](https://www.ffmpeg.org/download.html) or by installing it from npm:

```bash
$ npm install ffmpeg-static
$ yarn add ffmpeg-static
```

If you want to use Avconv instead of FFmpeg, install it on your system or place Avconv executable at the root of your project.
Expand All @@ -45,9 +45,9 @@ If you want to use Avconv instead of FFmpeg, install it on your system or place
You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:

```bash
$ npm install ytdl-core
$ npm install play-dl
$ npm install @distube/ytdl-core
$ yarn add ytdl-core
$ yarn add play-dl
$ yarn add @distube/ytdl-core
```

Done with all these? Let's write a simple music bot then.
Expand Down
16 changes: 8 additions & 8 deletions apps/website/pages/docs/guides/welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a c
#### Main Library

```bash
$ npm install discord-player # main library
$ npm install @discord-player/extractor # extractors provider
$ yarn add discord-player # main library
$ yarn add @discord-player/extractor # extractors provider
```

> Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
Expand All @@ -41,16 +41,16 @@ $ npm install @discord-player/extractor # extractors provider
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:

```bash
$ npm install @discordjs/opus
$ npm install opusscript
$ yarn add @discordjs/opus
$ yarn add opusscript
```

#### FFmpeg or Avconv

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:

```bash
$ npm install ffmpeg-static
$ yarn add ffmpeg-static
```

You can get avconv from [https://libav.org/download](https://libav.org/download).
Expand All @@ -60,9 +60,9 @@ You can get avconv from [https://libav.org/download](https://libav.org/download)
You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:

```bash
$ npm install ytdl-core
$ npm install play-dl
$ npm install @distube/ytdl-core
$ yarn add ytdl-core
$ yarn add play-dl
$ yarn add @distube/ytdl-core
```

Done with all these? Let's write a simple music bot then.
Expand Down
11 changes: 6 additions & 5 deletions docs/faq/common_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Install opus encoder.

```sh
$ npm install @discordjs/opus
$ yarn add @discordjs/opus
# or
$ npm install opusscript
$ yarn add opusscript
# or
$ npm install node-opus
$ yarn add node-opus
```

# FFmpeg/Avconv not found
Expand All @@ -17,7 +17,7 @@ Make sure you have `FFmpeg` or `Avconv` available on your system.
### Install FFmpeg or Avconv

- Download from official FFmpeg website: **[www.ffmpeg.org/download.html](https://www.ffmpeg.org/download.html)**
- Node Module (ffmpeg-static): **[npmjs.com/package/ffmpeg-static](https://npmjs.com/package/ffmpeg-static)**
- Node Module (ffmpeg-static): **[npmjs.com/package/ffmpeg-static](https://npmjs.com/package/ffmpeg-static) (ffmpeg-static is not recommended)**
- Avconv: If you want to use Avconv instead of FFmpeg, install it on your system or place Avconv executable at the root of your project.

# "something" is not working
Expand All @@ -26,6 +26,7 @@ Make sure you have `FFmpeg` or `Avconv` available on your system.

- If you are getting weird errors like something is not a constructor or version.split is not a function or something similar, please try the following:

Remove `node_modules`, `package-lock.json` or any lockfiles you have, run `npm cache clean --force` or similar command equivalent to your package manager and then run `npm install` (or the install command of your package manager)
* If you are using `npm`, remove `node_modules`, `package-lock.json` or any lockfiles you have, run `npm cache clean --force` or similar command equivalent to your package manager and then run `npm install` (or the install command of your package manager).
* If the above step does not fix the issue, try using another package manager like `yarn` or `pnpm` or `bun`.

- If you are unable to solve the problem, please join our official support server 👉 [https://androz2091.fr/discord](https://androz2091.fr/discord)
16 changes: 8 additions & 8 deletions docs/migrating/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a c
#### Main Library

```bash
$ npm install discord-player # main library
$ npm install @discord-player/extractor # extractors provider
$ yarn add discord-player # main library
$ yarn add @discord-player/extractor # extractors provider
```

> Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
Expand All @@ -24,8 +24,8 @@ $ npm install @discord-player/extractor # extractors provider
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:

```bash
$ npm install @discordjs/opus
$ npm install opusscript
$ yarn add @discordjs/opus
$ yarn add opusscript
```

#### FFmpeg / Avconv
Expand All @@ -35,7 +35,7 @@ FFmpeg or Avconv is required for media transcoding.
You can get FFmpeg from [ffmpeg.org](https://www.ffmpeg.org/download.html) or by installing it from npm:

```bash
$ npm install ffmpeg-static
$ yarn add ffmpeg-static
```

If you want to use Avconv instead of FFmpeg, install it on your system or place Avconv executable at the root of your project.
Expand All @@ -45,9 +45,9 @@ If you want to use Avconv instead of FFmpeg, install it on your system or place
You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:

```bash
$ npm install ytdl-core
$ npm install play-dl
$ npm install @distube/ytdl-core
$ yarn add ytdl-core
$ yarn add play-dl
$ yarn add @distube/ytdl-core
```

Done with all these? Let's write a simple music bot then.
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Local PlayerNode adapter that provides interface to Discord Player
## Installation

```sh
$ npm install @discord-player/adapter-local
$ yarn add @discord-player/adapter-local
```
2 changes: 1 addition & 1 deletion packages/adapter-remote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Remote PlayerNode adapter that provides interface to Discord Player
## Installation

```sh
$ npm install @discord-player/adapter-remote
$ yarn add @discord-player/adapter-remote
```
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Discord Player core components
## Installation

```sh
$ npm install @discord-player/core
$ yarn add @discord-player/core
```

This library is internally used by `discord-player`. This library handles all the work related to voice and provides a way to communicate with nodes.
16 changes: 8 additions & 8 deletions packages/discord-player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Discord Player requires Discord.js 14.0 or higher. PLease make sure you have a c
#### Main Library

```bash
$ npm install discord-player # main library
$ npm install @discord-player/extractor # extractors provider
$ yarn add discord-player # main library
$ yarn add @discord-player/extractor # extractors provider
```

> Discord Player recognizes `@discord-player/extractor` and loads it automatically by default.
Expand All @@ -41,16 +41,16 @@ $ npm install @discord-player/extractor # extractors provider
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:

```bash
$ npm install @discordjs/opus
$ npm install opusscript
$ yarn add @discordjs/opus
$ yarn add opusscript
```

#### FFmpeg or Avconv

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:

```bash
$ npm install ffmpeg-static
$ yarn add ffmpeg-static
```

You can get avconv from [https://libav.org/download](https://libav.org/download).
Expand All @@ -60,9 +60,9 @@ You can get avconv from [https://libav.org/download](https://libav.org/download)
You also need to install streaming library if you want to add support for youtube playback. You can install one of these libraries:

```bash
$ npm install ytdl-core
$ npm install play-dl
$ npm install @distube/ytdl-core
$ yarn add ytdl-core
$ yarn add play-dl
$ yarn add @distube/ytdl-core
```

Done with all these? Let's write a simple music bot then.
Expand Down
2 changes: 1 addition & 1 deletion packages/equalizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This library implements Lavaplayer's 15 Band PCM Equalizer & biquad utilities.
## Installation

```sh
$ npm install --save @discord-player/equalizer
$ yarn add --save @discord-player/equalizer
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Discord Player utilities
## Installation

```sh
$ npm install @discord-player/utils
$ yarn add @discord-player/utils
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion packages/voice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A high level framework for Discord VoIP client.
## Installation

```sh
$ npm install --save @discord-player/voice
$ yarn add --save @discord-player/voice
```

## Example
Expand Down
Loading

0 comments on commit bd4e49d

Please sign in to comment.