Skip to content

Feature: Discord Rich Presence - #139

Merged
Mrmayman merged 75 commits into
Mrmayman:mainfrom
hitblast:main
Apr 17, 2026
Merged

Mrmayman merged 75 commits into
Mrmayman:mainfrom
hitblast:main

Conversation

@hitblast

@hitblast hitblast commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: I'm trying to get Discord's Rich Presence connected with the launcher using a tiny library that I'm working on alongside this PR. Here is the link in case if you want to check out.

As of now, I'll be working on it actively until I hit compatibility on all three major platforms, till then I have some goals which I'll put here:

  • Initial commit with a working demo.
  • Obey the message model of iced.
  • Add rich presence update events to places of interest as a final touch.
  • Possibly add a setting to enable/disable rich presence?
  • Add supervisor for reconnecting the IPC client in sync with Discord opening/reopening.
  • Implement a "Presence" settings tab for managing the core Discord Presence client.

More will be added as the feature continues. I'd like your consideration on this as it'd be a tough time deciding what messages and states to include this. Currently I've only modified the Launcher state to support this, which I assumed is shared globally (I might be wrong here).

Cheers.

image

@Sreehari425

Sreehari425 commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

Hey, @hitblast i looked at implementation of discord ipc client , and it appears to be having MSRV of 1.85.1 (verfied by cargo-msrv)
the launcher official MSRV is pinned down to 1.82.0

@hitblast

hitblast commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

@Sreehari425 Oh, forgot to adjust the edition to 2021; will shortly push commits to the library to handle that.

@Mrmayman

Mrmayman commented Feb 5, 2026 •

Copy link
Copy Markdown
Owner

my thoughts:

  • so far it seems decent in terms of structure like you asked, it's fine
  • i'd prefer if you made lots of stuff async (especially in Launcher::new, idk if that's blocking tho). Using tokio's spawn_blocking for non async functions. Responsiveness is a priority
  • can you sort out windows support too later as it's a key requirement?
  • i had some ideas for a detailed presence config screen in launcher settings where you can customize stuff. What do you think?
  • i may be slow or late to respond/review sometimes, so sorry about that in advance. I'm just super busy so please don't mind if i'm late to anything

@hitblast

hitblast commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

my thoughts:

  • so far it seems decent in terms of structure like you asked, it's fine
  • i'd prefer if you made lots of stuff async (especially in Launcher::new, idk if that's blocking tho). Using tokio's spawn_blocking for non async functions. Responsiveness is a priority
  • can you sort out windows support too later as it's a key requirement?
  • i had some ideas for a detailed presence config screen in launcher settings where you can customize stuff. What do you think?
  • i may be slow or late to respond/review sometimes, so sorry about that in advance. I'm just super busy so please don't mind if i'm late to anything

I was thinking about the async part, as its mostly just UnixStream being handed off to separate threads in the deep level. I'll work on implementing spawn_blocking. Also Windows support will be sorted as soon as tomorrow I think since I've been working on a pipe idea. Also, for any other ideas, I guess we could continue this on the Discord server. I've already left a message for your convenience.

Looking forward!

Comment thread quantum_launcher/src/state/mod.rs Resolved
Co-authored-by: SreehariAnil255 <69724114+Sreehari425@users.noreply.github.com>
@hitblast

hitblast commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Update: I'm currently a little busy and will return to this PR once I'm done.

@hitblast

hitblast commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@Mrmayman @Sreehari425 A little update; I've implemented a base configuration for the rich presence functionality which includes a few different things now:

  • Modification to the message_handler module so that there are two new functions for initializing and updating the rich presence on startup or anywhere inside the codebase.
  • Task::perform implementation as promised since a pipe might not be available as always and therefore if not, QuantumLauncher will skip it.

I'll need some review over my implementation since I am a bit rusty with iced but hopefully we can build upon this to integrate it into several other views and functions of the launcher.

@Mrmayman

Copy link
Copy Markdown
Owner

Alright i read through your code, seems okay 👍 you can continue like that

btw if you need me at any time, i'll finally be free for help with this PR and general development after next Wednesday, when my exams get over. Till then i may be a bit slow to respond or work on stuff but i'll try to help

@hitblast

hitblast commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Alright i read through your code, seems okay 👍 you can continue like that

btw if you need me at any time, i'll finally be free for help with this PR and general development after next Wednesday, when my exams get over. Till then i may be a bit slow to respond or work on stuff but i'll try to help

Sure! For the most part, I'm interested about the states which you want to put rich presence updates in (for example in certain views such as the mod menu or instance selections). I'd also need some help regarding what details to put in them. That's about it.

Appreciate it.

@hitblast hitblast changed the title Feature: Discord Rich Presence (active development ongoing) Feature: Discord Rich Presence [WIP] Feb 15, 2026
@hitblast
hitblast force-pushed the main branch 2 times, most recently from 70b4b8d to 18420e1 Compare February 16, 2026 04:46
@hitblast hitblast changed the title Feature: Discord Rich Presence [WIP] Feature: Discord Rich Presence Apr 7, 2026
@Mrmayman

Copy link
Copy Markdown
Owner

Ok all the review, testing and tweaks from my side are done 👍

i made some changes:

  • Move config fields to separate struct
  • Split message into separate RpcMessage
  • Many tweaks to data types and how it's stored

let me see if Copilot has anything to see (AI review)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Discord Rich Presence integration to QuantumLauncher (via filthy-rich), including UI controls and configuration for enabling/disabling and customizing presence text.

Changes:

  • Introduces Discord RPC config (discord_rpc) and new “Presence” settings tab to manage Rich Presence behavior and text.
  • Starts and manages a Discord IPC runner, updates presence on launcher/game lifecycle events, and surfaces status in the UI.
  • Adjusts macOS packaging/build scripts and workflow app bundle naming; updates onboarding changelog/welcome screens to include RPC toggles.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/sequoia_arm64_build.sh Adds a macOS 15 (Sequoia) arm64 build + .app bundling script.
quantum_launcher/src/view.rs Wires is_presence_running into settings view; passes config into changelog view.
quantum_launcher/src/update.rs Handles new Discord IPC lifecycle messages; returns Task from game-exit handling.
quantum_launcher/src/state/mod.rs Adds launcher state for Discord IPC client + presence-running flag.
quantum_launcher/src/state/message.rs Adds RPC-related messages and conversions into the existing message model.
quantum_launcher/src/state/menu.rs Adds a new “Presence” tab to launcher settings navigation.
quantum_launcher/src/message_update/mod.rs Implements RPC settings updates, enable/disable behavior, and settings-state helper.
quantum_launcher/src/message_update/edit_instance.rs Refactors Option initialization to get_or_insert_default().
quantum_launcher/src/message_update/accounts.rs Refactors accounts config initialization to get_or_insert_default().
quantum_launcher/src/message_handler/mod.rs Implements presence updates on game open/exit; adds IPC runner start + set-presence helpers.
quantum_launcher/src/message_handler/iced_event.rs Uses new settings-state helper; refactors Option init for window config.
quantum_launcher/src/menu_renderer/settings/tab_presence.rs New Presence settings tab UI for toggles + text customization.
quantum_launcher/src/menu_renderer/settings/mod.rs Registers Presence tab and threads presence-running state into settings rendering.
quantum_launcher/src/menu_renderer/onboarding/welcome.rs Adds an onboarding toggle to enable Discord Rich Presence.
quantum_launcher/src/menu_renderer/onboarding/changelog.rs Adds RPC toggle to changelog screen; updates/rewrites changelog content.
quantum_launcher/src/menu_renderer/mod.rs Changes changelog view to accept config and forward to changelog renderer.
quantum_launcher/src/main.rs Starts Discord IPC runner at startup when RPC is enabled in config.
quantum_launcher/src/config/mod.rs Adds discord_rpc config field, helpers (c_rpc_enabled, reset_presence), and module export.
quantum_launcher/src/config/discord_rpc.rs New serialized RPC config types + defaults and text templates.
quantum_launcher/Cargo.toml Adds filthy-rich dependency (and reorders/normalizes some deps).
crates/ql_packager/src/multimc.rs Refactors Option initialization to get_or_insert_default().
crates/ql_mod_manager/src/loaders/optifine.rs Refactors Option initialization to get_or_insert_default() and simplifies imports.
crates/ql_core/src/json/instance_config.rs Refactors Option initialization to get_or_insert_default().
changelogs/unreleased.md Documents the new Discord Rich Presence feature in the unreleased changelog.
Cargo.lock Locks in filthy-rich and updates transitive deps (e.g., tokio/mio).
.github/workflows/release.yml Normalizes macOS .app bundle directory name.
.github/workflows/build-macos.yml Normalizes macOS .app bundle directory name and adjusts deployment env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +383 to +391
// On disable
let client = self.discord_ipc_client.clone();
self.is_presence_running = false;

tokio::spawn(async move {
if let Some(c) = client {
_ = c.close().await;
}
});

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

When RPC is toggled off, the code closes the client asynchronously but leaves self.discord_ipc_client populated. This keeps a stale handle around and makes it harder to reason about later updates (and interacts with in-flight DiscordIPCRunStarted/DiscordIPCPresenceSet messages). Clear self.discord_ipc_client (and consider ignoring/closing any late-started client) as part of the disable path.

Copilot uses AI. Check for mistakes.
Comment thread scripts/sequoia_arm64_build.sh Resolved
Comment thread quantum_launcher/src/update.rs Resolved
Comment thread quantum_launcher/src/update.rs Resolved
Mrmayman and others added 2 commits April 14, 2026 12:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Mrmayman

Copy link
Copy Markdown
Owner

@hitblast can you take a look at these

@Mrmayman

Copy link
Copy Markdown
Owner

LGTM, merging

@Mrmayman
Mrmayman merged commit f7568bb into Mrmayman:main Apr 17, 2026
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.

4 participants