Skip to content

Conversation

@ThePotato97
Copy link

@ThePotato97 ThePotato97 commented Apr 25, 2025

closes #186

Add Discord Rich Presence (RPC) Support

This adds basic support for Discord Rich Presence to psst.

If you enable it and provide a valid Discord Application ID, the app will connect to your running Discord client and show the currently playing track in your profile.


Changes

  • Added a new discord_rpc.rs module under psst-core to manage the Discord RPC connection in a background thread.
  • Added discord-presence as a new dependency.
  • Extended the user configuration with two new fields:
    • discord_rpc_enable (bool)
    • discord_rpc_app_id (string)
  • Updated the Preferences UI with:
    • A checkbox to enable/disable Discord RPC.
    • A text field for entering your Discord App ID.
    • A button linking to Discord Developer Portal if you need to create one.
  • Hooked the RPC updates into the PlaybackController:
    • Starts the RPC client when enabled (and app ID is valid).
    • Updates it live if the App ID changes.
    • Shuts it down cleanly when disabled or when quitting.

Behavior

  • Nothing happens unless the user explicitly enables the feature.
  • Invalid App IDs are rejected cleanly with warnings.
  • If playback changes (play, pause, seek, next track), the Discord status updates automatically.
  • Disconnects and clears the Discord status when pausing or stopping playback.

Notes

  • Only one new real dependency was added: discord-presence.
  • Defaults are safe: Discord RPC is disabled by default.

Screenshots

image
image


Why

Because Discord status is cool
and now people can see what garbage music you're listening to in real time.

Copy link
Collaborator

@jacksongoode jacksongoode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice - thank you for contributing! but I'd like to do a proper re-review after the unrelated linting changes were resolved.

@SO9010
Copy link
Collaborator

SO9010 commented May 6, 2025

I had a little skim over this PR! It's looking good so far!

Also I think the taplo.toml shouldn't be included to the PR.

@SO9010
Copy link
Collaborator

SO9010 commented Jun 17, 2025

Just a question, do we have to make it so that the user makes up their ID or are we able to say generate it for them so its more automatic?

@Cleboost
Copy link
Contributor

Cleboost commented Jun 30, 2025

Link #186 to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord Rich Presence is not showing

4 participants