User Presence Not Always Correct

I am a bot creator who has made several bots that connect Roblox to other platforms, most notably Discord. For a few of my bots, I check a player’s Roblox presence to see if they are in a certain game. If they are, then I start logging their time spent in the game. I check every ~3 minutes to see if they are still in the same game.

The website has had many issues over the years of a player being in-game, but having their profile (and the API) say that they are either offline, or that they are marked as just “Online” with the blue marker, indicating that they’re just on the website.

This is especially challenging to combat as some players never have this issue, some have it for a minute then it resolves itself, and some have it constantly and consistently. These players are all desktop players, and I believe all of them use the Roblox version for the website and only use the app when it is launched from the website.

Expected behavior

Player presence on the website & API endpoints should accurately show a player’s status. If they are in-game, then it should consistently and constantly show that.

It can be inconsistent at times, and yes it’s because of desktop players like myself that never ever close their browser while having their PC on (or have extensions like RoPro) that keeps their presence on 24/7 by calling some Roblox API often.

I own a Discord bot like you do, same purpose and have it where users can track Roblox players and have status updates etc sent to their DMs. The way I combat this was just adding a “consecutive count” to the system but only for these scenarios:

  • User that was previously in game (presence code 2) appearing online on website (user presence code 1)
  • User appears offline (presence code 0) from being online (presence 1) or being in game (presence 2)

It’d count up to 3 times and if their updated presence stayed at the same status code on the 3rd consecutive count (I run my checks at ~90 second intervals), it would then notify the user with the latest user presence data in DMs.

If the presences did not stay before the third consecutive count, it’d just reset back to 0 without notifying the user at all. That way, haven’t had problems with inconsistency since then and it doesn’t spam the users tracking these Roblox players.