@@ -13,6 +13,22 @@ namespace Discord.API | |||||
public Optional<string> StreamUrl { get; set; } | public Optional<string> StreamUrl { get; set; } | ||||
[JsonProperty("type")] | [JsonProperty("type")] | ||||
public Optional<StreamType?> StreamType { get; set; } | public Optional<StreamType?> StreamType { get; set; } | ||||
[JsonProperty("details")] | |||||
public Optional<string> Details { get; set; } | |||||
[JsonProperty("state")] | |||||
public Optional<string> State { get; set; } | |||||
[JsonProperty("application_id")] | |||||
public Optional<ulong> ApplicationId { get; set; } | |||||
[JsonProperty("assets")] | |||||
public Optional<API.GameAssets> Assets { get; set; } | |||||
[JsonProperty("party")] | |||||
public Optional<API.GameParty> Party { get; set; } | |||||
[JsonProperty("secrets")] | |||||
public Optional<API.GameSecrets> Secrets { get; set; } | |||||
[JsonProperty("timestamps")] | |||||
public Optional<API.GameTimestamps> Timestamps { get; set; } | |||||
[JsonProperty("instance")] | |||||
public Optional<bool> Instance { get; set; } | |||||
[OnError] | [OnError] | ||||
internal void OnError(StreamingContext context, ErrorContext errorContext) | internal void OnError(StreamingContext context, ErrorContext errorContext) | ||||
@@ -0,0 +1,16 @@ | |||||
using Newtonsoft.Json; | |||||
namespace Discord.API | |||||
{ | |||||
internal class GameAssets | |||||
{ | |||||
[JsonProperty("small_text")] | |||||
public Optional<string> SmallText { get; } | |||||
[JsonProperty("small_image")] | |||||
public Optional<string> SmallImage { get; } | |||||
[JsonProperty("large_image")] | |||||
public Optional<string> LargeText { get; } | |||||
[JsonProperty("large_text")] | |||||
public Optional<string> LargeImage { get; } | |||||
} | |||||
} |
@@ -0,0 +1,12 @@ | |||||
using Newtonsoft.Json; | |||||
namespace Discord.API | |||||
{ | |||||
internal class GameParty | |||||
{ | |||||
[JsonProperty("id")] | |||||
public ulong Id { get; set; } | |||||
[JsonProperty("size")] | |||||
public ulong[] Size { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
using Newtonsoft.Json; | |||||
namespace Discord.API | |||||
{ | |||||
internal class GameSecrets | |||||
{ | |||||
[JsonProperty("match")] | |||||
public string Match { get; set; } | |||||
[JsonProperty("join")] | |||||
public string Join { get; set; } | |||||
[JsonProperty("spectate")] | |||||
public string Spectate { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
using System; | |||||
using Newtonsoft.Json; | |||||
namespace Discord.API | |||||
{ | |||||
internal class GameTimestamps | |||||
{ | |||||
[JsonProperty("start")] | |||||
public DateTimeOffset Start { get; set; } | |||||
[JsonProperty("end")] | |||||
public DateTimeOffset End { get; set; } | |||||
} | |||||
} |
@@ -10,7 +10,8 @@ | |||||
<ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" /> | <ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup Condition=" '$(TargetFramework)' != 'net45' "> | <ItemGroup Condition=" '$(TargetFramework)' != 'net45' "> | ||||
<PackageReference Include="System.Net.Http" Version="4.3.2" /> <!-- https://github.com/dotnet/corefx/issues/19535 --> | |||||
<PackageReference Include="System.Net.Http" Version="4.3.2" /> | |||||
<!-- https://github.com/dotnet/corefx/issues/19535 --> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' "> | <ItemGroup Condition=" '$(TargetFramework)' == 'net45' "> | ||||
<Reference Include="System.Net.Http" /> | <Reference Include="System.Net.Http" /> | ||||