📝 Add example for setRepeatMode method

This commit is contained in:
Androz2091 2020-06-21 17:24:18 +02:00
parent 9e329c8aa6
commit fd5f312f5f

View file

@ -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) => {