Browse Source

Use ApplicationId to define a rich presence

pull/877/head
Christopher F 7 years ago
parent
commit
bb3c1c287c
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Activities/RichGame.cs
  2. +3
    -3
      src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Activities/RichGame.cs View File

@@ -7,7 +7,7 @@ namespace Discord
{
public string Details { get; internal set;}
public string State { get; internal set;}
public ulong? ApplicationId { get; internal set; }
public ulong ApplicationId { get; internal set; }
public GameAssets Assets { get; internal set; }
public GameParty Party { get; internal set; }
public GameSecrets Secrets { get; internal set; }


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

@@ -5,9 +5,9 @@
public static IActivity ToEntity(this API.Game model)
{
// Rich Game
if (model.Details.IsSpecified)
if (model.ApplicationId.IsSpecified)
{
var appId = model.ApplicationId.ToNullable();
ulong appId = model.ApplicationId.Value;
return new RichGame
{
ApplicationId = appId,
@@ -15,7 +15,7 @@
Details = model.Details.GetValueOrDefault(),
State = model.State.GetValueOrDefault(),
Assets = model.Assets.GetValueOrDefault()?.ToEntity(appId ?? 0),
Assets = model.Assets.GetValueOrDefault()?.ToEntity(appId),
Party = model.Party.GetValueOrDefault()?.ToEntity(),
Secrets = model.Secrets.GetValueOrDefault()?.ToEntity(),
Timestamps = model.Timestamps.GetValueOrDefault()?.ToEntity()


Loading…
Cancel
Save