💄 Fix README style
This commit is contained in:
parent
33a92434c3
commit
1d9e312246
1 changed files with 7 additions and 3 deletions
10
README.md
10
README.md
|
@ -15,6 +15,7 @@ npm install --save discord-player
|
||||||
```
|
```
|
||||||
|
|
||||||
Install **opusscript** or **@discordjs/opus**:
|
Install **opusscript** or **@discordjs/opus**:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save opusscript
|
npm install --save opusscript
|
||||||
```
|
```
|
||||||
|
@ -116,12 +117,13 @@ client.player.play(voiceChannel, songName, requestedBy);
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
client.on('message', async (message) => {
|
client.on('message', async (message) => {
|
||||||
|
|
||||||
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
|
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
|
||||||
const command = args.shift().toLowerCase();
|
const command = args.shift().toLowerCase();
|
||||||
|
|
||||||
// !play Despacito
|
// !play Despacito
|
||||||
// will play "Despacito" in the member voice channel
|
// will play "Despacito" in the member voice channel
|
||||||
|
|
||||||
|
@ -258,7 +260,7 @@ client.on('message', async (message) => {
|
||||||
|
|
||||||
if(command === 'play'){
|
if(command === 'play'){
|
||||||
let aSongIsAlreadyPlaying = client.player.isPlaying(message.guild.id);
|
let aSongIsAlreadyPlaying = client.player.isPlaying(message.guild.id);
|
||||||
// If there's already a song playing
|
// If there's already a song playing
|
||||||
if(aSongIsAlreadyPlaying){
|
if(aSongIsAlreadyPlaying){
|
||||||
// Add the song to the queue
|
// Add the song to the queue
|
||||||
let song = await client.player.addToQueue(message.guild.id, args[0]);
|
let song = await client.player.addToQueue(message.guild.id, args[0]);
|
||||||
|
@ -326,7 +328,7 @@ client.on('message', (message) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output:
|
* Output:
|
||||||
*
|
*
|
||||||
* Server queue:
|
* Server queue:
|
||||||
* Current - Despacito | Luis Fonsi
|
* Current - Despacito | Luis Fonsi
|
||||||
* #2 - Memories | Maroon 5
|
* #2 - Memories | Maroon 5
|
||||||
|
@ -427,6 +429,7 @@ client.on('message', async (message) => {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
|
||||||
To remove a song from the queue, use the `client.player.remove()` function.
|
To remove a song from the queue, use the `client.player.remove()` function.
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
|
@ -455,6 +458,7 @@ client.on('message', async (message) => {
|
||||||
## Info Messages
|
## Info Messages
|
||||||
|
|
||||||
You can send a message when the queue ends or when the song changes:
|
You can send a message when the queue ends or when the song changes:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
client.on('message', (message) => {
|
client.on('message', (message) => {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue