📝 Add example for setRepeatMode method
This commit is contained in:
parent
9e329c8aa6
commit
fd5f312f5f
1 changed files with 20 additions and 0 deletions
|
@ -339,6 +339,26 @@ class Player {
|
|||
* @param {Discord.Snowflake} guildID
|
||||
* @param {Boolean} enabled Whether the repeat mode should be enabled
|
||||
* @returns {Promise<Void>}
|
||||
*
|
||||
* @example
|
||||
* client.on('message', async (message) => {
|
||||
* const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
|
||||
* const command = args.shift().toLowerCase();
|
||||
*
|
||||
* if(command === 'repeat-mode'){
|
||||
* const repeatModeEnabled = client.player.getQueue(message.guild.id).repeatMode;
|
||||
* if(repeatModeEnabled){
|
||||
* // if the repeat mode is currently enabled, disable it
|
||||
* client.player.setRepeatMode(message.guild.id, false);
|
||||
* message.channel.send("Repeat mode disabled! The current song will no longer be played again and again...");
|
||||
* } else {
|
||||
* // if the repeat mode is currently disabled, enable it
|
||||
* client.player.setRepeatMode(message.guild.id, true);
|
||||
* message.channel.send("Repeat mode enabled! The current song will be played again and again until you run the command again!");
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* });
|
||||
*/
|
||||
setRepeatMode (guildID, enabled) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Reference in a new issue