fix: Team is nullable, not optional (#1672)

This commit is contained in:
Paulo
2020-11-09 15:39:08 -03:00
committed by GitHub
parent 05a1f0a709
commit be60d813f7
2 changed files with 3 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ namespace Discord.API
[JsonProperty("bot_require_code_grant")]
public bool BotRequiresCodeGrant { get; set; }
[JsonProperty("team")]
public Optional<Team> Team { get; set; }
public Team Team { get; set; }
[JsonProperty("flags"), Int53]
public Optional<ulong> Flags { get; set; }

View File

@@ -59,8 +59,8 @@ namespace Discord.Rest
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 && model.Team.Value != null)
Team = RestTeam.Create(Discord, model.Team.Value);
if (model.Team != null)
Team = RestTeam.Create(Discord, model.Team);
}
/// <exception cref="InvalidOperationException">Unable to update this object from a different application token.</exception>