From c785e5a2fd73376ed1e490737160e6af39717a87 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Tue, 12 Nov 2019 23:01:12 -0800 Subject: [PATCH] fix: false-positive detection of CustomStatusGame based on Id property This change fixes a bug that was introduced in PR #1406. Games were falsely detected to be CustomStatusGames, based on the Id property being included in the model payload. This fixes the false detection of Games as CustomStatusGame. An activity will only be considered a CustomStatusGame if the Id has a value of "custom". This change has been tested by listening to the GuildMemberUpdated event, and opening/closing games with a custom status set. --- src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs b/src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs index bad72aaea..cbea6d905 100644 --- a/src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs +++ b/src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs @@ -10,7 +10,7 @@ namespace Discord.WebSocket public static IActivity ToEntity(this API.Game model) { // Custom Status Game - if (model.Id.IsSpecified) + if (model.Id.IsSpecified && model.Id.Value == "custom") { return new CustomStatusGame() {