feature: Add missing application properties (including Teams) (#1604)

* Add missing application properties

Add IsBotPublic, BotRequiresCodeGrant, and Team properties to IApplication

* To immutable list

* Change list to array
This commit is contained in:
Paulo
2020-11-08 18:13:41 -03:00
committed by GitHub
parent 1ab670b3fc
commit 10fcde0a32
12 changed files with 213 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
@@ -15,6 +15,12 @@ namespace Discord.API
public ulong Id { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("bot_public")]
public bool IsBotPublic { get; set; }
[JsonProperty("bot_require_code_grant")]
public bool BotRequiresCodeGrant { get; set; }
[JsonProperty("team")]
public Optional<Team> Team { get; set; }
[JsonProperty("flags"), Int53]
public Optional<ulong> Flags { get; set; }

View File

@@ -0,0 +1,9 @@
namespace Discord.API
{
internal enum MembershipState
{
None = 0,
Invited = 1,
Accepted = 2,
}
}

View File

@@ -0,0 +1,17 @@
#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
{
internal class Team
{
[JsonProperty("icon")]
public Optional<string> Icon { get; set; }
[JsonProperty("id")]
public ulong Id { get; set; }
[JsonProperty("members")]
public TeamMember[] TeamMembers { get; set; }
[JsonProperty("owner_user_id")]
public ulong OwnerUserId { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
{
internal class TeamMember
{
[JsonProperty("membership_state")]
public MembershipState MembershipState { get; set; }
[JsonProperty("permissions")]
public string[] Permissions { get; set; }
[JsonProperty("team_id")]
public ulong TeamId { get; set; }
[JsonProperty("user")]
public User User { get; set; }
}
}