From 7fa041bb22879a96e3ce9ad0db3ab9a23888b283 Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Sun, 21 Jun 2020 17:26:55 +0200 Subject: [PATCH] :pencil: Add example for the nowPlaying method --- src/Player.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Player.js b/src/Player.js index 0bbf577..7ca6956 100644 --- a/src/Player.js +++ b/src/Player.js @@ -322,6 +322,19 @@ class Player { * Get the currently playing track * @param {Discord.Snowflake} guildID * @returns {Promise} The track which is currently played + * + * @example + * client.on('message', async (message) => { + * + * const args = message.content.slice(settings.prefix.length).trim().split(/ +/g); + * const command = args.shift().toLowerCase(); + * + * if(command === 'now-playing'){ + * let track = await client.player.nowPlaying(message.guild.id); + * message.channel.send(`Currently playing ${track.name}...`); + * } + * + * }); */ nowPlaying (guildID) { return new Promise((resolve, reject) => {