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

@@ -21,6 +21,12 @@ namespace Discord.Rest
public string[] RPCOrigins { get; private set; }
/// <inheritdoc />
public ulong Flags { get; private set; }
/// <inheritdoc />
public bool IsBotPublic { get; private set; }
/// <inheritdoc />
public bool BotRequiresCodeGrant { get; private set; }
/// <inheritdoc />
public ITeam Team { get; private set; }
/// <inheritdoc />
public IUser Owner { get; private set; }
@@ -46,11 +52,15 @@ namespace Discord.Rest
RPCOrigins = model.RPCOrigins;
Name = model.Name;
_iconId = model.Icon;
IsBotPublic = model.IsBotPublic;
BotRequiresCodeGrant = model.BotRequiresCodeGrant;
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);
if (model.Team.IsSpecified)
Team = RestTeam.Create(Discord, model.Team.Value);
}
/// <exception cref="InvalidOperationException">Unable to update this object from a different application token.</exception>