feat: skip-reason telemetry via emoji reactions on now-playing

Merged
LU
6mo ago
+616-5

Summary

Implements GitHub issue #1093: capture optional skip-reason telemetry when users react with emojis to the now-playing message control.

Adds four skip-reason emoji reactions (πŸ‘Ž, 😴, 🎸, πŸ”) that map to telemetry values (generic_dislike, too_chill, mood_mismatch, repeat). Updates Recommendation.skipReason non-blockingly; persistence failures do not break the skip flow.

Implementation

  • reactionHandler: New handleSkipReasonReaction() function captures emoji reactions and persists skip reason via Prisma
  • trackNowPlaying: Adds skip-reason emoji reactions to now-playing message (both edit and create paths)
  • recommendationTelemetry: New recordRecommendationSkipReason() service function for database updates
  • schema: Optional skipReason field added to Recommendation model
  • tests: Comprehensive test suite covering emoji mappings, error handling, and non-blocking semantics

Test Results

  • All 2521 bot tests passing (2527 total, 6 skipped)
  • All 12 reactionHandler emoji reaction tests passing
  • All 5 recordRecommendationSkipReason persistence tests passing

Related

Closes #1093


Summary by cubic

Captures skip-reason telemetry from emoji reactions on the now-playing message. Adds πŸ‘Ž 😴 🎸 πŸ” β†’ generic_dislike, too_chill, mood_mismatch, repeat; non-blocking persistence with guild+track-URL matching that refreshes on now-playing edits (closes #1093; fixes #1377).

  • New Features

    • Adds skip-reason reactions to now-playing (create + edit). Central emojiβ†’reason map in skipReasonMap.ts; now-playing stores trackUrl and refreshes it on edits; reactions are only handled for the current message.
    • reactionHandler records reasons via recordRecommendationSkipReason (typed SkipReason) and finds the latest recommendation by guildId + trackUrl; bot/non-relevant reactions are ignored; DB errors are logged and ignored.
  • Migration

    • Apply 20260613040000_add_recommendation_skip_reason to add the SkipReason enum and nullable Recommendation.skipReason column.