Add Song.requestedBy usage and remove example (#18)
Co-Authored-By: Androz <androz2091@gmail.com>
This commit is contained in:
parent
7bde7bfbe3
commit
33a92434c3
1 changed files with 31 additions and 4 deletions
35
README.md
35
README.md
|
@ -65,6 +65,8 @@ client.player.clearQueue(guildID);
|
||||||
client.player.getQueue(guildID);
|
client.player.getQueue(guildID);
|
||||||
// Skip the current song
|
// Skip the current song
|
||||||
client.player.skip(guildID);
|
client.player.skip(guildID);
|
||||||
|
// Remove a song from the queue using the index number
|
||||||
|
client.player.remove(guildID, song);
|
||||||
|
|
||||||
|
|
||||||
// Pause
|
// Pause
|
||||||
|
@ -110,7 +112,7 @@ To play a song, use the `client.player.play()` function.
|
||||||
**Usage:**
|
**Usage:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
client.player.play(voiceChannel, songName);
|
client.player.play(voiceChannel, songName, requestedBy);
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
|
@ -124,8 +126,8 @@ client.on('message', async (message) => {
|
||||||
// will play "Despacito" in the member voice channel
|
// will play "Despacito" in the member voice channel
|
||||||
|
|
||||||
if(command === 'play'){
|
if(command === 'play'){
|
||||||
let song = await client.player.play(message.member.voice.channel, args[0])
|
let song = await client.player.play(message.member.voice.channel, args[0], message.member.user.tag);
|
||||||
message.channel.send(`Currently playing ${song.name}!`);
|
message.channel.send(`Currently playing ${song.name}! - Requested by ${song.requestedBy}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -424,6 +426,32 @@ client.on('message', async (message) => {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Remove
|
||||||
|
To remove a song from the queue, use the `client.player.remove()` function.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
|
||||||
|
```js
|
||||||
|
client.player.remove(guildID, song);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```js
|
||||||
|
client.on('message', async (message) => {
|
||||||
|
|
||||||
|
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
|
||||||
|
const command = args.shift().toLowerCase();
|
||||||
|
|
||||||
|
if(command === 'remove'){
|
||||||
|
// Removes a song from the queue
|
||||||
|
client.player.remove(message.guild.id, args[0]).then(() => {
|
||||||
|
message.channel.send('Removed song!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## 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:
|
||||||
|
@ -487,4 +515,3 @@ These bots are made by the community, they can help you build your own!
|
||||||
|
|
||||||
* [Discord-Music](https://github.com/hydraindia/discord-music) by [hydraindia](https://github.com/hydraindia)
|
* [Discord-Music](https://github.com/hydraindia/discord-music) by [hydraindia](https://github.com/hydraindia)
|
||||||
* [Music-bot](https://github.com/ZerioDev/Music-bot) by [ZerioDev](https://github.com/ZerioDev)
|
* [Music-bot](https://github.com/ZerioDev/Music-bot) by [ZerioDev](https://github.com/ZerioDev)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue