Browse Source

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.
tags/2.2.0
Chris Johnston Christopher F 5 years ago
parent
commit
a4846516fb
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)
{
// Custom Status Game
if (model.Id.IsSpecified)
if (model.Id.IsSpecified && model.Id.Value == "custom")
{
return new CustomStatusGame()
{


Loading…
Cancel
Save