From de84385de1eac7b26a4050dde3b1a59acb4424fd Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 16 Jul 2023 19:42:14 +0200 Subject: [PATCH 1/4] fix: make text where command is referenced bold --- commands/queue.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/queue.js b/commands/queue.js index 9f29f11..efd5816 100644 --- a/commands/queue.js +++ b/commands/queue.js @@ -50,7 +50,7 @@ module.exports = { }); } - queueString = 'The queue is empty, add some tracks with `/play`!'; + queueString = 'The queue is empty, add some tracks with **`/play`**!'; return await interaction.editReply({ embeds: [ new EmbedBuilder() @@ -86,7 +86,7 @@ module.exports = { } if (queue.tracks.data.length === 0) { - queueString = 'The queue is empty, add some tracks with `/play`!'; + queueString = 'The queue is empty, add some tracks with **`/play`**!'; } else { queueString = queue.tracks.data .slice(pageIndex * 10, pageIndex * 10 + 10) From 9010060a1561c3f02f533a9b236cb5b8a3253b2e Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 16 Jul 2023 19:42:30 +0200 Subject: [PATCH 2/4] fix: add support for configurable icons for different sources --- config.json.example | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.json.example b/config.json.example index ebff6f7..1008754 100644 --- a/config.json.example +++ b/config.json.example @@ -69,7 +69,12 @@ "volumeIsMuted": "🔇", "volumeChanged": "🔊", "volumeMuted": "🔇", - "queue": "🎶" + "queue": "🎶", + "sourceArbitrary": "🎵", + "sourceAppleMusic": "🎵", + "sourceYouTube": "🎵", + "sourceSoundCloud": "🎵", + "sourceSpotify": "🎵" }, "filterThreadAmount": "2", "filterList": [ From 52ef374be3c0aa53b662835d9b20e3562b9ee193 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 16 Jul 2023 19:42:46 +0200 Subject: [PATCH 3/4] fix: add more debug logging --- index.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index c48e4d1..8b1b0ca 100644 --- a/index.js +++ b/index.js @@ -64,11 +64,11 @@ onBeforeCreateStream(async (track) => { if (process.env.NODE_ENV === 'development') { player.on('debug', (message) => { - logger.debug(message); + logger.debug(`player debug event: ${message}`); }); player.events.on('debug', (message) => { - logger.trace(message); + logger.trace(`player queue debug event: ${message}`); }); } @@ -82,6 +82,14 @@ player.events.on('playerError', (queue, error) => { logger.error(error, 'Player audio stream error event'); }); +player.events.on('playerStart', (queue, track) => { + logger.debug(`playerStart event: Started playing '${track.title}'.`); +}); + +player.events.on('playerSkip', (queue, track) => { + logger.debug(`playerSkip event: Failed to play '${track.title}'.`); +}); + client.once('ready', async () => { // This method will load all the extractors from the @discord-player/extractor package await player.extractors.loadDefault(); @@ -167,9 +175,11 @@ client.on('interactionCreate', async (interaction) => { embeds: [ new EmbedBuilder() .setDescription( - `**Warning**\n**This command took ${ + `**${ + embedIcons.warning + } Warning**\nThis command took ${ executionTime / 1000 - } seconds to execute.**\n\n_If you experienced problems with the command, please try again._` + } seconds to execute.\n\n_If you experienced problems with the command, please try again._` ) .setColor(embedColors.colorWarning) ] From a554551022980bcf58f422d937e693c574edfc83 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 16 Jul 2023 19:42:58 +0200 Subject: [PATCH 4/4] fix: now showing icon for source in /nowplaying --- commands/nowplaying.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/commands/nowplaying.js b/commands/nowplaying.js index 51f93c3..e71cf7d 100644 --- a/commands/nowplaying.js +++ b/commands/nowplaying.js @@ -59,6 +59,14 @@ module.exports = { ['arbitrary', 'Direct source'] ]); + const sourceIcons = new Map([ + ['youtube', embedIcons.sourceYouTube], + ['soundcloud', embedIcons.sourceSoundCloud], + ['spotify', embedIcons.sourceSpotify], + ['apple_music', embedIcons.sourceAppleMusic], + ['arbitrary', embedIcons.sourceArbitrary] + ]); + const currentTrack = queue.currentTrack; let author = currentTrack.author ? currentTrack.author : 'Unavailable'; @@ -157,7 +165,9 @@ module.exports = { }, { name: '**Audio source**', - value: `**[${source}](${currentTrack.url})**`, + value: `**${sourceIcons.get( + currentTrack.raw.source + )} [${source}](${currentTrack.url})**`, inline: true } )