From e49de342ed93b6a1a79238946164aada5d1974e5 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 11:47:13 +0100 Subject: [PATCH] Discord Rich Presence: the Horizon application's id Discord's "Horizon" application (1563857609738690560, public) has the horizon logo as its large image; no game-mode images yet. The feature is live: only HORIZON_NO_DISCORD=1, the switch and automated runs keep it quiet. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/discord_presence.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/horizon-client/src/discord_presence.rs b/crates/horizon-client/src/discord_presence.rs index 83d9118e6..5c25960fb 100644 --- a/crates/horizon-client/src/discord_presence.rs +++ b/crates/horizon-client/src/discord_presence.rs @@ -4,7 +4,7 @@ //! length u32 LE + JSON). The game only calls [`set`] each frame: a change wakes the thread, //! which connects when Discord runs, retries every 15 s when it doesn't, keeps under Discord's //! update limit and clears the activity on quit. Nothing is sent with the setting off, -//! with `HORIZON_NO_DISCORD=1`, or while [`DISCORD_APP_ID`] is the placeholder. +//! or with `HORIZON_NO_DISCORD=1`. use std::collections::VecDeque; use std::io::{self, Read, Write}; use std::path::PathBuf; @@ -16,12 +16,11 @@ use serde_json::{Value, json}; use crate::command::args::GameMode; -/// The "Horizon" application on Discord's developer portal (public: it names the game). -/// Until it exists this is the placeholder, and the feature stays inert. -pub const DISCORD_APP_ID: &str = PLACEHOLDER_APP_ID; -const PLACEHOLDER_APP_ID: &str = "0"; +/// The "Horizon" application on Discord's developer portal (public: it names the game). Its +/// Rich Presence assets: `horizon`, the logo. +pub const DISCORD_APP_ID: &str = "1563857609738690560"; /// Whether the application has the game-mode images (`survival`, `creative`, `adventure`, -/// `spectator`) beside the `horizon` logo. +/// `spectator`) beside the logo; it doesn't yet. const MODE_IMAGES: bool = false; /// Points the game at a test's fake Discord (a folder holding `discord-ipc-0`). const IPC_DIR_ENV: &str = "HORIZON_DISCORD_IPC_DIR"; @@ -114,10 +113,9 @@ static THREAD: OnceLock = OnceLock::new(); /// `automated` runs (offscreen, benchmarks) only talk to a test's fake Discord. pub fn start(enabled: bool, automated: bool) { let fake_discord = std::env::var_os(IPC_DIR_ENV).is_some(); - let real_discord = !automated && DISCORD_APP_ID != PLACEHOLDER_APP_ID; if THREAD.get().is_some() || std::env::var_os("HORIZON_NO_DISCORD").is_some_and(|v| v != "0") - || !(fake_discord || real_discord) + || (automated && !fake_discord) { return; }