discord-player
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "discord-player", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Complete framework to facilitate music commands using discord.js v12", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,2 +64,4 @@ # Discord Player | ||
client.player.getQueue(guildID); | ||
// Skip the current song | ||
client.player.skip(guildID); | ||
// Pause | ||
@@ -118,3 +120,3 @@ client.player.pause(guildID); | ||
To pause the current song, use the `client.manager.pause()` function. | ||
To pause the current song, use the `client.player.pause()` function. | ||
@@ -145,3 +147,3 @@ **Usage:** | ||
To resume the current song, use the `client.manager.resume()` function. | ||
To resume the current song, use the `client.player.resume()` function. | ||
@@ -172,3 +174,3 @@ **Usage:** | ||
To stop the music, use the `client.manager.stop()` function. | ||
To stop the music, use the `client.player.stop()` function. | ||
@@ -199,3 +201,3 @@ **Usage:** | ||
To update the volume, use the `client.manager.setVolume()` function. | ||
To update the volume, use the `client.player.setVolume()` function. | ||
@@ -325,2 +327,28 @@ **Usage:** | ||
### Skip | ||
To skip the current song, use the `client.player.skip()` function. | ||
**Usage:** | ||
```js | ||
client.player.skip(guildID); | ||
``` | ||
**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 === 'skip'){ | ||
let song = await client.player.skip(message.guild.id); | ||
message.channel.send(`${song} skipped!`); | ||
} | ||
}); | ||
``` | ||
## Info Messages | ||
@@ -327,0 +355,0 @@ |
@@ -226,3 +226,3 @@ const ytdl = require('ytdl-core'); | ||
* @param {string} guildID | ||
* @returns {Promise<Queue>} | ||
* @returns {Promise<Song>} | ||
*/ | ||
@@ -234,7 +234,8 @@ skip(guildID){ | ||
if(!queue) reject('Not playing'); | ||
let currentSong = queue.songs[0]; | ||
// Ends the dispatcher | ||
queue.dispatcher.end(); | ||
queue.skipped = true; | ||
// Resolves guild queue | ||
resolve(queue); | ||
// Resolves the current song | ||
resolve(currentSong); | ||
}); | ||
@@ -241,0 +242,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24586
434
399