Browse Source

Add rich presence button

pull/1923/head
quin lynch 3 years ago
parent
commit
ba9da7b2ca
4 changed files with 23 additions and 3 deletions
  1. +2
    -0
      src/Discord.Net.Rest/API/Common/Game.cs
  2. +18
    -0
      src/Discord.Net.Rest/API/Common/RichPresenceButton.cs
  3. +1
    -1
      src/Discord.Net.Rest/Net/Converters/ArrayConverter.cs
  4. +2
    -2
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj

+ 2
- 0
src/Discord.Net.Rest/API/Common/Game.cs View File

@@ -41,6 +41,8 @@ namespace Discord.API
public Optional<Emoji> Emoji { get; set; }
[JsonProperty("created_at")]
public Optional<long> CreatedAt { get; set; }
[JsonProperty("buttons")]
public Optional<RichPresenceButton[]> Buttons { get; set; }

[OnError]
internal void OnError(StreamingContext context, ErrorContext errorContext)


+ 18
- 0
src/Discord.Net.Rest/API/Common/RichPresenceButton.cs View File

@@ -0,0 +1,18 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Discord.API
{
internal class RichPresenceButton
{
[JsonProperty("label")]
public string Label { get; set; }

[JsonProperty("url")]
public string Url { get; set; }
}
}

+ 1
- 1
src/Discord.Net.Rest/Net/Converters/ArrayConverter.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;



+ 2
- 2
src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Discord.Net.targets" />
<Import Project="../../StyleAnalyzer.targets" />
<PropertyGroup>
@@ -18,7 +18,7 @@
<DocumentationFile>..\Discord.Net.WebSocket\Discord.Net.WebSocket.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;</DefineConstants>
</PropertyGroup>
<ItemGroup>


Loading…
Cancel
Save