Skip to content

feat(music): update voice channel status on track start - #660

Merged
LucasSantana-Dev merged 3 commits into
mainfrom
feature/voice-channel-status
Apr 16, 2026
Merged

LucasSantana-Dev merged 3 commits into
mainfrom
feature/voice-channel-status

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Apr 16, 2026 •

Copy link
Copy Markdown
Owner

Replace global bot presence with per-voice-channel status showing track info.

Changes

  • VoiceChannelStatusService: New service handling status updates (100% coverage)
    • Sets status on track start: 🎵 Title — Author
    • Clears status on disconnect/queue end
    • Graceful permission error handling (debug log, no crash)
    • Truncates to 500 chars max
  • trackHandlers: Calls setTrackStatus on playerStart, clearStatus on playerFinish/skip
  • lifecycleHandlers: Clears status on connectionDestroyed/emptyChannel/disconnect
  • Removed: MusicPresenceService (replaced by VoiceChannelStatusService)
  • Global presence: Unaffected, still rotates guild/member stats

Verification

  • Tests: 2606 passed (VoiceChannelStatusService: 100% coverage)
  • TypeScript: No errors
  • Discord.js v14.26.2 supports channel.setStatus()

Deploy

After merge, rebuild on server: ssh server-do-luk "cd /home/luk-server/Lucky && git pull && docker compose build bot && docker rm -f lucky-bot && docker compose up -d bot"

Summary by CodeRabbit

  • Refactor
    • Removed music presence feature that displayed current track information in bot status updates

… presence)

- Replaces global bot presence activity with per-voice-channel status
- Status shows track title and author, truncated to 500 chars
- Gracefully handles permission errors with debug/error logging
- Clears status on disconnect, queue end, and channel leave
- Global presence rotation still active for guild stats
- VoiceChannelStatusService: 100% test coverage
- All 2606 bot tests pass
@LucasSantana-Dev
LucasSantana-Dev enabled auto-merge (squash) April 16, 2026 22:37
@vercel

vercel Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Apr 16, 2026 11:10pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18eaa7ca-db15-4311-a11f-d9ffac9560f3

📥 Commits

Reviewing files that changed from the base of the PR and between 86cba3a and 72516f9.

📒 Files selected for processing (7)
  • packages/bot/src/handlers/clientHandler/service.spec.ts
  • packages/bot/src/handlers/clientHandler/service.ts
  • packages/bot/src/handlers/player/lifecycleHandlers.ts
  • packages/bot/src/handlers/player/trackHandlers.spec.ts
  • packages/bot/src/handlers/player/trackHandlers.ts
  • packages/bot/src/services/MusicPresenceService.spec.ts
  • packages/bot/src/services/MusicPresenceService.ts
💤 Files with no reviewable changes (7)
  • packages/bot/src/handlers/clientHandler/service.spec.ts
  • packages/bot/src/handlers/clientHandler/service.ts
  • packages/bot/src/handlers/player/trackHandlers.ts
  • packages/bot/src/handlers/player/trackHandlers.spec.ts
  • packages/bot/src/handlers/player/lifecycleHandlers.ts
  • packages/bot/src/services/MusicPresenceService.spec.ts
  • packages/bot/src/services/MusicPresenceService.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Security
  • GitHub Check: Quality Gates
  • GitHub Check: SonarCloud Scan

📝 Walkthrough

Walkthrough

This PR removes the entire MusicPresenceService module and all its integrations across the codebase. The service was responsible for updating bot presence status during music playback and controlling presence rotation. All related imports, calls, and test mocks are also eliminated.

Changes

Cohort / File(s) Summary
Service Removal
packages/bot/src/services/MusicPresenceService.ts, packages/bot/src/services/MusicPresenceService.spec.ts
Removed entire service module (56 lines) and corresponding test suite (209 lines) that managed Discord bot presence updates and rotation control during music playback.
Handler Integrations
packages/bot/src/handlers/clientHandler/service.ts, packages/bot/src/handlers/player/trackHandlers.ts, packages/bot/src/handlers/player/lifecycleHandlers.ts
Removed all imports and function calls to MusicPresenceService from client initialization, track event handlers (handlePlayerStart, handlePlayerFinish, handlePlayerSkip), and player lifecycle handlers (connectionDestroyed, emptyChannel, disconnect).
Test Mocks
packages/bot/src/handlers/clientHandler/service.spec.ts, packages/bot/src/handlers/player/trackHandlers.spec.ts
Removed Jest mocks for MusicPresenceService and updated test assertions that previously expected calls to setNowPlaying and clearMusicPresence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement, bot, size/xl

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title focuses on updating voice channel status on track start, but the primary change is actually removing MusicPresenceService and replacing it with VoiceChannelStatusService—a significant refactoring that the title doesn't capture. Revise the title to reflect the main change: something like 'refactor(music): replace MusicPresenceService with VoiceChannelStatusService' would better represent the scope and intent of this changeset.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/voice-channel-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added enhancement New feature or request size/xl labels Apr 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit bf515fd into main Apr 16, 2026
12 checks passed
LucasSantana-Dev added a commit that referenced this pull request May 13, 2026
… presence) (#660)

- Replaces global bot presence activity with per-voice-channel status
- Status shows track title and author, truncated to 500 chars
- Gracefully handles permission errors with debug/error logging
- Clears status on disconnect, queue end, and channel leave
- Global presence rotation still active for guild stats
- VoiceChannelStatusService: 100% test coverage
- All 2606 bot tests pass
@LucasSantana-Dev
LucasSantana-Dev deleted the feature/voice-channel-status branch May 23, 2026 02:21

This branch was successfully deployed

1 active deployment
Preview — ace2f6f4 Deployed Apr 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot enhancement New feature or request size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant