Browse Source

Remove GameAsset#ToEntity

- appId doesn't seem to be necessary, and Spotify Game doesn't return appId either.
pull/970/head
Hsu Still 7 years ago
parent
commit
904458f54a
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs

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

@@ -16,7 +16,7 @@ namespace Discord.WebSocket
if (model.ApplicationId.IsSpecified) if (model.ApplicationId.IsSpecified)
{ {
ulong appId = model.ApplicationId.Value; ulong appId = model.ApplicationId.Value;
var assets = model.Assets.GetValueOrDefault()?.ToEntity(appId);
var assets = model.Assets.GetValueOrDefault()?.ToEntity();
return new RichGame return new RichGame
{ {
ApplicationId = appId, ApplicationId = appId,
@@ -42,19 +42,17 @@ namespace Discord.WebSocket
} }


// (Small, Large) // (Small, Large)
public static GameAsset[] ToEntity(this API.GameAssets model, ulong appId)
public static GameAsset[] ToEntity(this API.GameAssets model)
{ {
return new GameAsset[] return new GameAsset[]
{ {
model.SmallImage.IsSpecified ? new GameAsset model.SmallImage.IsSpecified ? new GameAsset
{ {
ApplicationId = appId,
ImageId = model.SmallImage.GetValueOrDefault(), ImageId = model.SmallImage.GetValueOrDefault(),
Text = model.SmallText.GetValueOrDefault() Text = model.SmallText.GetValueOrDefault()
} : null, } : null,
model.LargeImage.IsSpecified ? new GameAsset model.LargeImage.IsSpecified ? new GameAsset
{ {
ApplicationId = appId,
ImageId = model.LargeImage.GetValueOrDefault(), ImageId = model.LargeImage.GetValueOrDefault(),
Text = model.LargeText.GetValueOrDefault() Text = model.LargeText.GetValueOrDefault()
} : null, } : null,


Loading…
Cancel
Save