Browse Source

update Activity extension methods to support Details field

pull/1237/head
Chris Johnston 6 years ago
parent
commit
4c1fc910bd
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs

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

@@ -26,7 +26,7 @@ namespace Discord.WebSocket
Duration = timestamps?.End - timestamps?.Start, Duration = timestamps?.End - timestamps?.Start,
AlbumArtUrl = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null, AlbumArtUrl = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null,
Type = ActivityType.Listening, Type = ActivityType.Listening,
Flags = model.Flags.GetValueOrDefault()
Flags = model.Flags.GetValueOrDefault(),
}; };
} }


@@ -54,10 +54,16 @@ namespace Discord.WebSocket
{ {
return new StreamingGame( return new StreamingGame(
model.Name, model.Name,
model.StreamUrl.Value);
model.StreamUrl.Value)
{
Flags = model.Flags.GetValueOrDefault(),
Details = model.Details.GetValueOrDefault()
};
} }
// Normal Game // Normal Game
return new Game(model.Name, model.Type.GetValueOrDefault() ?? ActivityType.Playing);
return new Game(model.Name, model.Type.GetValueOrDefault() ?? ActivityType.Playing,
model.Flags.IsSpecified ? model.Flags.Value : ActivityProperties.None,
model.Details.GetValueOrDefault());
} }


// (Small, Large) // (Small, Large)


Loading…
Cancel
Save