From a4846516fbce6cc3f80c04be43667f34048e23c4 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Fri, 29 Nov 2019 19:13:08 -0800 Subject: [PATCH] fix: false-positive detection of CustomStatusGame based on Id property (#1416) 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 5149eea5b..cbe575075 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() {