Reflect AFK/DND status in Rich Presence (small_image + [AFK] suffix)#8
Draft
PrEvIeS wants to merge 1 commit intoezbooz:mainfrom
Draft
Reflect AFK/DND status in Rich Presence (small_image + [AFK] suffix)#8PrEvIeS wants to merge 1 commit intoezbooz:mainfrom
PrEvIeS wants to merge 1 commit intoezbooz:mainfrom
Conversation
Detect `: AFK mode is now ON. Autoreply "..."` and `: AFK mode is now OFF` (also DND variants) from Client.txt and reflect that state in Discord Rich Presence. - AFK ON: append "[AFK]" to the state string and replace the small_image with "afk". The previous small_image (derived from the player's class / ascendency) is snapshotted so AFK OFF can restore EXACTLY this value even if a level-up happened during the AFK window. - AFK OFF: restore the snapshotted small_image; clear the snapshot. `update_rpc()` gains two optional kwargs (`small_image_override`, `afk_suffix`) that default to the pre-existing behaviour, so all current call sites stay byte-identical. Implementation is fully gated behind the new `regex_afk` match — non-AFK lines hit zero new code paths. Note: requires uploading an `afk.png` asset to the Discord developer portal under the application's Rich Presence assets (see README).
6 tasks
PrEvIeS
added a commit
to PrEvIeS/Path-Of-Exile-2-RPC
that referenced
this pull request
May 5, 2026
…in EN/RU/UA The 4-PR upstream campaign (panvex-b6p) is feature-complete on this stacked branch. Updates the user-facing READMEs and CLAUDE.md to reflect the four shipped capabilities: - Official PoE2 client support (Steam + PathOfExile.exe) - Owner auto-pin (party-mate disambiguation) - AFK / DND status with small-image override + restore - Background tray service + Windows Startup shortcut README.md / README.ru.md / README.ua.md - Add explicit Features bullets for all four capabilities. - Flip the To-Do checklist (now 5/5 complete). - RU/UA translations get the new "Run as a background service" section to match the English README that was added during PR-4. CLAUDE.md - Replace the four open-work items with checked-off equivalents and a pointer to the upstream draft PRs (ezbooz#6, ezbooz#7, ezbooz#8, ezbooz#9). Notes that the remaining work is the end-of-campaign Windows live-smoke pass.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Detect AFK/DND mode toggles from
Client.txtand reflect them in Discord Rich Presence:[AFK]to the state string and swap the small image toafk.Detected log lines:
: AFK mode is now ON. Autoreply "...": AFK mode is now OFF: DND mode is now ON. Autoreply "...": DND mode is now OFFDiff scope
+48 / −2inmain.py. Two new optional kwargs onupdate_rpckeep every existing call site byte-identical — the only new code path is gated behind aregex_afk.search(line)match, so non-AFK lines run through unchanged.Asset requirement
Upload an
afk.pngto the Discord developer portal under the application's Rich Presence assets so thesmall_image="afk"lookup resolves. README addendum incoming as a follow-up if helpful.Test plan
/afk onin chat → Discord status shows... [AFK]and the AFK icon.[AFK]and AFK icon persist for the AFK transition; subsequent level/area pings revert to default behaviour (this PR keeps the diff minimal — full "AFK suffix on every update" can be a follow-up)./afk off→ Discord restores the exact pre-AFK class icon (Witch / Infernalist / etc.)./dnd onand/dnd off.Backport notes
This is a hand-backport of a feature developed in a hexagonal-DDD fork (
src/poe2_rpc/). The upstream-facing diff is intentionally surgical and stays insidemonitor_log()+update_rpc().🤖 Backport prepared with Claude Code