@@ -19,7 +19,7 @@ namespace Discord | |||||
/// <summary> Gets the guild this invite is linked to. </summary> | /// <summary> Gets the guild this invite is linked to. </summary> | ||||
IGuild Guild { get; } | IGuild Guild { get; } | ||||
/// <summary> Gets the id of the guild this invite is linked to. </summary> | /// <summary> Gets the id of the guild this invite is linked to. </summary> | ||||
ulong GuildId { get; } | |||||
ulong? GuildId { get; } | |||||
/// <summary> Gets the name of the guild this invite is linked to. </summary> | /// <summary> Gets the name of the guild this invite is linked to. </summary> | ||||
string GuildName { get; } | string GuildName { get; } | ||||
/// <summary> Gets the approximated count of online members in the guild. </summary> | /// <summary> Gets the approximated count of online members in the guild. </summary> | ||||
@@ -8,7 +8,7 @@ namespace Discord.API | |||||
[JsonProperty("code")] | [JsonProperty("code")] | ||||
public string Code { get; set; } | public string Code { get; set; } | ||||
[JsonProperty("guild")] | [JsonProperty("guild")] | ||||
public InviteGuild Guild { get; set; } | |||||
public Optional<InviteGuild> Guild { get; set; } | |||||
[JsonProperty("channel")] | [JsonProperty("channel")] | ||||
public InviteChannel Channel { get; set; } | public InviteChannel Channel { get; set; } | ||||
[JsonProperty("approximate_presence_count")] | [JsonProperty("approximate_presence_count")] | ||||
@@ -14,7 +14,7 @@ namespace Discord.Rest | |||||
public int? PresenceCount { get; private set; } | public int? PresenceCount { get; private set; } | ||||
public int? MemberCount { get; private set; } | public int? MemberCount { get; private set; } | ||||
public ulong ChannelId { get; private set; } | public ulong ChannelId { get; private set; } | ||||
public ulong GuildId { get; private set; } | |||||
public ulong? GuildId { get; private set; } | |||||
internal IChannel Channel { get; private set; } | internal IChannel Channel { get; private set; } | ||||
internal IGuild Guild { get; private set; } | internal IGuild Guild { get; private set; } | ||||
@@ -35,9 +35,9 @@ namespace Discord.Rest | |||||
} | } | ||||
internal void Update(Model model) | internal void Update(Model model) | ||||
{ | { | ||||
GuildId = model.Guild.Id; | |||||
GuildId = model.Guild.IsSpecified ? model.Guild.Value.Id : default(ulong?); | |||||
ChannelId = model.Channel.Id; | ChannelId = model.Channel.Id; | ||||
GuildName = model.Guild.Name; | |||||
GuildName = model.Guild.IsSpecified ? model.Guild.Value.Name : null; | |||||
ChannelName = model.Channel.Name; | ChannelName = model.Channel.Name; | ||||
MemberCount = model.MemberCount.IsSpecified ? model.MemberCount.Value : null; | MemberCount = model.MemberCount.IsSpecified ? model.MemberCount.Value : null; | ||||
PresenceCount = model.PresenceCount.IsSpecified ? model.PresenceCount.Value : null; | PresenceCount = model.PresenceCount.IsSpecified ? model.PresenceCount.Value : null; | ||||