Skip to content

Fix Discord playtime counter resetting on every activity change#36973

Merged
peppy merged 1 commit intoppy:masterfrom
SupDos:discord-timestamp
Mar 17, 2026
Merged

Fix Discord playtime counter resetting on every activity change#36973
peppy merged 1 commit intoppy:masterfrom
SupDos:discord-timestamp

Conversation

@SupDos
Copy link
Copy Markdown
Contributor

@SupDos SupDos commented Mar 15, 2026

Discord resets the playtime counter on the rich presence whenever the status changes since there's no timestamp set as the start time for the activity. This PR adds the timestamp as Timestamps.Now as per the library docs

Before After
before.mp4
after.mp4

private readonly RichPresence presence = new RichPresence
{
Assets = new Assets { LargeImageKey = "osu_logo_lazer" },
Timestamps = Timestamps.Now,
Copy link
Copy Markdown
Contributor

@LiquidPL LiquidPL Mar 15, 2026

Choose a reason for hiding this comment

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

Just noting that this will make the timestamp be set only once when the game starts, it will not be updated whenever the activity changes. I don't remember for sure if this was the behaviour already before Discord broke it, but I suppose it might be worth updating it (in a future PR) to display time spent in beatmap/MP lobby/etc., since that's how the rich presence seems to be used nowadays.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was the behaviour previously yeah, but at some point about a year ago discord decided to start resetting the counter on every activity change if there was no timestamp set.
I think most people are used to this timer being a "how long has the game been open" timer, as that is how it works in other games/non rich presence games and every once in a while I see people ask why it keeps resetting every time, recent example from dev discord.

@SupDos SupDos changed the title Add timestamp to rich presence Fix Discord playtime counter resetting on every activity change Mar 15, 2026
@SynesthesiaDev
Copy link
Copy Markdown

I think the timestamp should actually reset (and use the other countdown timer) whenever you are playing a beatmap to show progress

@SupDos
Copy link
Copy Markdown
Contributor Author

SupDos commented Mar 15, 2026

They've removed the countdown timer as well sadly, now you can only use that if you use a Listening or Watching status (see the library docs)

@Joehuu
Copy link
Copy Markdown
Member

Joehuu commented Mar 15, 2026

They've removed the countdown timer as well sadly, now you can only use that if you use a Listening or Watching status (see the library docs)

It is possible. The image of Timestamps.FromTimespan is wrong. It should show an hourglass with time counting down.

@peppy peppy self-requested a review March 17, 2026 03:03
@peppy peppy merged commit f237348 into ppy:master Mar 17, 2026
3 of 8 checks passed
SK-la pushed a commit to SK-la/Ez2Lazer that referenced this pull request Mar 17, 2026
…36973)

Discord resets the playtime counter on the rich presence whenever the
status changes since there's no timestamp set as the start time for the
activity. This PR adds the timestamp as `Timestamps.Now` as per the
[library
docs](https://lachee.github.io/discord-rpc-csharp/articles/features/timestamps.html)

<table>
<tr>
 <td> Before
 <td> After
<tr>
 <td>


https://github.com/user-attachments/assets/a745967a-3dfa-4f70-938c-a9abd45866c6


 <td>


https://github.com/user-attachments/assets/09c24fde-f150-4a3b-bb6a-afb325561508


</table>
@SupDos SupDos deleted the discord-timestamp branch March 17, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants