From 042327d4aa5d59568c7d49c9f255755aef4e44f2 Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 30 Apr 2020 23:55:12 +0200 Subject: [PATCH] Add online user counting back (ish) --- PluralKit.Bot/Services/PeriodicStatCollector.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/Services/PeriodicStatCollector.cs b/PluralKit.Bot/Services/PeriodicStatCollector.cs index 75d68165..ef2171b9 100644 --- a/PluralKit.Bot/Services/PeriodicStatCollector.cs +++ b/PluralKit.Bot/Services/PeriodicStatCollector.cs @@ -72,9 +72,8 @@ namespace PluralKit.Bot foreach (var user in guild.Members.Values) { usersKnown.Add(user.Id); - - // Presence updates are disabled, for now we just assume every user is online, I guess - usersOnline.Add(user.Id); + if (user.Presence?.Status == UserStatus.Online) + usersOnline.Add(user.Id); } _metrics.Measure.Gauge.SetValue(BotMetrics.MembersTotal, usersKnown.Count);