Browse Source

Updated Application model

tags/1.0-rc
RogueException 8 years ago
parent
commit
a1fd14fff0
3 changed files with 10 additions and 25 deletions
  1. +5
    -4
      src/Discord.Net.Core/API/Common/Application.cs
  2. +5
    -2
      src/Discord.Net.Rest/Entities/RestApplication.cs
  3. +0
    -19
      src/Discord.Net.Rpc/API/Rpc/Application.cs

+ 5
- 4
src/Discord.Net.Core/API/Common/Application.cs View File

@@ -11,13 +11,14 @@ namespace Discord.API
public string[] RPCOrigins { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("flags"), Int53]
public ulong Flags { get; set; }
[JsonProperty("owner")]
public User Owner { get; set; }
[JsonProperty("id")]
public ulong Id { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }

[JsonProperty("flags"), Int53]
public Optional<ulong> Flags { get; set; }
[JsonProperty("owner")]
public Optional<User> Owner { get; set; }
}
}

+ 5
- 2
src/Discord.Net.Rest/Entities/RestApplication.cs View File

@@ -34,9 +34,12 @@ namespace Discord.Rest
Description = model.Description;
RPCOrigins = model.RPCOrigins;
Name = model.Name;
Flags = model.Flags;
Owner = RestUser.Create(Discord, model.Owner);
_iconId = model.Icon;

if (model.Flags.IsSpecified)
Flags = model.Flags.Value; //TODO: Do we still need this?
if (model.Owner.IsSpecified)
Owner = RestUser.Create(Discord, model.Owner.Value);
}

public async Task UpdateAsync()


+ 0
- 19
src/Discord.Net.Rpc/API/Rpc/Application.cs View File

@@ -1,19 +0,0 @@
#pragma warning disable CS1591
using Newtonsoft.Json;

namespace Discord.API.Rpc
{
public class Application
{
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("id")]
public ulong Id { get; set; }
[JsonProperty("rpc_origins")]
public string[] RpcOrigins { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
}
}

Loading…
Cancel
Save