Skip to content

feat(bot): add configurable presence status - #360

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
feat/presence-status-config
Mar 24, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
feat/presence-status-config

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Mar 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add BOT_PRESENCE_STATUS support for bot rotation presence and now-playing music presence
  • validate configured status values (online, idle, dnd, invisible) with fallback to online
  • add regression tests and update docs/changelog for the new env configuration

Verification

  • npm run test --workspace=packages/bot -- packages/bot/tests/handlers/clientHandler/presence.test.ts packages/bot/src/services/MusicPresenceService.spec.ts

Summary by CodeRabbit

  • New Features

    • Bot presence status can now be configured via environment variable, enabling dynamic control over availability states (online, idle, do-not-disturb, invisible) without code modifications.
  • Documentation

    • Updated implementation status guide with new configuration option and related capabilities.

@vercel

vercel Bot commented Mar 24, 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 Mar 24, 2026 1:26am

Request Review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Introduces a configurable environment variable BOT_PRESENCE_STATUS to dynamically set the bot's Discord presence status. A new utility module validates the configured value against allowed statuses (online, idle, dnd, invisible) with automatic fallback to online, and existing presence handlers integrate this utility to replace hardcoded status values.

Changes

Cohort / File(s) Summary
Configuration & Documentation
.env.example, CHANGELOG.md, docs/IMPLEMENTATION_STATUS.md
Added BOT_PRESENCE_STATUS environment variable documentation with default value online and allowed values. Updated changelog and implementation status tracking.
Presence Status Utility
packages/bot/src/utils/presenceStatus.ts
New module exports getBotPresenceStatus() function that reads and validates BOT_PRESENCE_STATUS from environment, returning sanitized value if valid or default online if invalid.
Presence Handlers
packages/bot/src/handlers/clientHandler/presence.ts, packages/bot/tests/handlers/clientHandler/presence.test.ts
Updated setPresenceActivity to use getBotPresenceStatus() instead of hardcoded 'online' status. Added test cases validating both valid and invalid configured status values.
Music Presence Service
packages/bot/src/services/MusicPresenceService.ts, packages/bot/src/services/MusicPresenceService.spec.ts
Updated setNowPlaying to dynamically set presence status via getBotPresenceStatus(). Added test cases covering valid/invalid status configurations and fallback behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested labels

bot

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main feature addition: a new configurable presence status capability for the bot.

✏️ 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 feat/presence-status-config

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.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
61.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit a4799cc into main Mar 24, 2026
11 of 12 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the feat/presence-status-config branch March 24, 2026 01:30

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant