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)
{
ulong appId = model.ApplicationId.Value;
var assets = model.Assets.GetValueOrDefault()?.ToEntity(appId);
var assets = model.Assets.GetValueOrDefault()?.ToEntity();
return new RichGame
{
ApplicationId = appId,
@@ -42,19 +42,17 @@ namespace Discord.WebSocket
}

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


Loading…
Cancel
Save