new Player(client, youtubeToken, options)
Parameters:
Name | Type | Description |
---|---|---|
client |
Client
|
Your Discord Client instance. |
youtubeToken |
string
|
Your Youtube Data v3 API key. |
options |
PlayerOptions
|
The PlayerOptions object. |
Members
client :Client
Your Discord Client instance.
Type:
-
Client
SYA :Youtube
The Simple Youtube API Client.
Type:
-
Youtube
youtubeToken :string
Your Youtube Data v3 API key.
Type:
-
string
Methods
addToQueue(guildID, songName) → {Promise.<Song>}
Adds a song to the guild queue.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
|
songName |
string
|
The name of the song to add to the queue. |
Returns:
- Type:
-
Promise.<Song>
clearQueue(guildID) → {Promise.<Queue>}
Clears the guild queue, but not the current song.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<Queue>
getQueue(guildID) → (nullable) {Queue}
Gets the guild queue.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Queue
isPlaying(guildID) → {Boolean}
Whether a guild is currently playing songs
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
The guild ID to check |
Returns:
- Type:
-
Boolean
Whether the guild is currently playing songs
nowPlaying(guildID) → {Promise.<Song>}
Gets the currently playing song.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<Song>
pause(guildID) → {Promise.<Song>}
Pauses the current song.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<Song>
play(voiceChannel, songName) → {Promise.<Song>}
Plays a song in a voice channel.
Parameters:
Name | Type | Description |
---|---|---|
voiceChannel |
voiceChannel
|
The voice channel in which the song will be played. |
songName |
string
|
The name of the song to play. |
Returns:
- Type:
-
Promise.<Song>
resume(guildID) → {Promise.<Song>}
Resumes the current song.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<Song>
setQueue(guildID, songs) → {Promise.<Queue>}
Sets the queue for a guild.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
|
songs |
Array.<Song>
|
The songs list |
Returns:
- Type:
-
Promise.<Queue>
setRepeatMode(guildID, enabled) → {Promise.<Void>}
Enable or disable the repeat mode
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
|
enabled |
Boolean
|
Whether the repeat mode should be enabled |
Returns:
- Type:
-
Promise.<Void>
setVolume(guildID, percent) → {Promise.<void>}
Updates the volume.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
|
percent |
number
|
Returns:
- Type:
-
Promise.<void>
skip(guildID) → {Promise.<Song>}
Skips a song.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<Song>
stop(guildID) → {Promise.<void>}
Stops playing music.
Parameters:
Name | Type | Description |
---|---|---|
guildID |
string
|
Returns:
- Type:
-
Promise.<void>