feature: add StartedAt, EndsAt, Elapsed and Remaining to SpotifyGame. (#1414)

* Fixed GetUsersAsync to use MaxUsersPerBatch const as limit instead of MaxMessagesPerBatch.

Requests are now returning up to 1000 guild user entities instead of the previous 100.

* Added StartedAt and EndsAt timespans for SpotifyGame.
They make it possible to expose track's Elapsed and Remaining properties.

* Moved Duration to be initialized within model construction.

* Updated StartedAt and EndsAt comments.
This commit is contained in:
Saulius Šaltenis
2019-11-30 05:11:48 +02:00
committed by Christopher F
parent e627f0780a
commit 2bba324143
2 changed files with 35 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ namespace Discord.WebSocket
AlbumTitle = albumText,
TrackTitle = model.Details.GetValueOrDefault(),
Artists = model.State.GetValueOrDefault()?.Split(';').Select(x=>x?.Trim()).ToImmutableArray(),
StartedAt = timestamps?.Start,
EndsAt = timestamps?.End,
Duration = timestamps?.End - timestamps?.Start,
AlbumArtUrl = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null,
Type = ActivityType.Listening,