Browse Source

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.
pull/1416/head
Chris Johnston 5 years ago
parent
commit
c785e5a2fd
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs

+ 1
- 1
src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs View File

@@ -10,7 +10,7 @@ namespace Discord.WebSocket
public static IActivity ToEntity(this API.Game model) public static IActivity ToEntity(this API.Game model)
{ {
// Custom Status Game // Custom Status Game
if (model.Id.IsSpecified)
if (model.Id.IsSpecified && model.Id.Value == "custom")
{ {
return new CustomStatusGame() return new CustomStatusGame()
{ {


Loading…
Cancel
Save