diff --git a/src/client/components/MusicLibrary.ts b/src/client/components/MusicLibrary.ts index 680cb38..f665e7d 100644 --- a/src/client/components/MusicLibrary.ts +++ b/src/client/components/MusicLibrary.ts @@ -167,7 +167,7 @@ class MusicLibrary implements Initialisable countSkip (name: string) { - this.#countStat(name, 'skip'); + this.#countStat(name, 'skips'); } resetStats () diff --git a/src/client/components/commands/Queue.ts b/src/client/components/commands/Queue.ts index 01c53af..b1cc4c5 100644 --- a/src/client/components/commands/Queue.ts +++ b/src/client/components/commands/Queue.ts @@ -35,7 +35,7 @@ class QueueCommand extends Command if (!queue.length) return 'Queue empty'; return ` - **Music queue:**\n${queue.map(entry => `\t\\- **${entry.title}** by ${entry.artist}`).join('\n')} + **Music queue:**\n\`\`\`${queue.map(entry => `\t\\- **${entry.title}** by ${entry.artist}`).join('\n')}\`\`\` `; } diff --git a/src/client/components/commands/Search.ts b/src/client/components/commands/Search.ts index ad419e9..1d29a22 100644 --- a/src/client/components/commands/Search.ts +++ b/src/client/components/commands/Search.ts @@ -36,7 +36,7 @@ class SearchCommand extends Command if (!results.length) return 'No results found'; return ` - **Search results:**\n${results.map(result => `\t\\- [id: ${result.id}] **${result.title}** - ${result.artist} (Album: ${result.album ?? 'Unknown'}) [${result.year ?? 'Unknown year'}]`).join('\n')} + **Search results:**\n\`\`\`${results.map(result => `\t\\- [id: ${result.id}] **${result.title}** - ${result.artist} (Album: ${result.album ?? 'Unknown'}) [${result.year ?? 'Unknown year'}]`).join('\n')}\`\`\` `; } } diff --git a/src/client/components/commands/Stats.ts b/src/client/components/commands/Stats.ts index 0f5dd19..13c5f3a 100644 --- a/src/client/components/commands/Stats.ts +++ b/src/client/components/commands/Stats.ts @@ -26,7 +26,10 @@ class StatsCommand extends Command async execute (_message: Message, { args }: CommandOpts) { if (args.reset?.value) + { this.client.musicPlayer.library.resetStats(); + return 'Stats reset'; + } const { stats } = this.client.musicPlayer.library; const mostPlayed = stats.sort((a, b) => b.plays - a.plays).slice(0, 10); const mostSkipped = stats.sort((a, b) => b.skips - a.skips).slice(0, 10); @@ -41,7 +44,7 @@ class StatsCommand extends Command const top10Plays = mostPlayed.map(mapper).join('\n'); stat = 'skips'; const top10Skips = mostSkipped.map(mapper).join('\n'); - return `**Music statistics**\n\nMost played:\n${top10Plays}\n\nMost skipped:\n${top10Skips}`; + return `**Music statistics**\n\nMost played:\n\`\`\`${top10Plays}\`\`\`\n\nMost skipped:\n\`\`\`${top10Skips}\`\`\``; } }