internal void Update(Model model) { base.Update(model); IsTemporary = model.Temporary; MaxAge = model.MaxAge; MaxUses = model.MaxUses; Uses = model.Uses; _createdAtTicks = model.CreatedAt.UtcTicks; }
internal void Update(Model model) { base.Update(model); Inviter = RestUser.Create(Discord, model.Inviter); IsRevoked = model.Revoked; IsTemporary = model.Temporary; MaxAge = model.MaxAge != 0 ? model.MaxAge : (int?)null; MaxUses = model.MaxUses; Uses = model.Uses; _createdAtTicks = model.CreatedAt.UtcTicks; }
internal void Update(Model model) { base.Update(model); Inviter = model.Inviter != null?RestUser.Create(Discord, model.Inviter) : null; IsRevoked = model.Revoked; IsTemporary = model.Temporary; MaxAge = model.MaxAge.IsSpecified ? model.MaxAge.Value : (int?)null; MaxUses = model.MaxUses.IsSpecified ? model.MaxUses.Value : (int?)null; Uses = model.Uses.IsSpecified ? model.Uses.Value : (int?)null; _createdAtTicks = model.CreatedAt.IsSpecified ? model.CreatedAt.Value.UtcTicks : (long?)null; }
public void Update(Model model, UpdateSource source) { if (source == UpdateSource.Rest && IsAttached) { return; } Inviter = new User(model.Inviter); IsRevoked = model.Revoked; IsTemporary = model.Temporary; MaxAge = model.MaxAge != 0 ? model.MaxAge : (int?)null; MaxUses = model.MaxUses; Uses = model.Uses; _createdAtTicks = model.CreatedAt.UtcTicks; }
internal static RestInviteMetadata Create(BaseDiscordClient discord, IGuild guild, IChannel channel, Model model) { var entity = new RestInviteMetadata(discord, guild, channel, model.Code); entity.Update(model); return(entity); }
public InviteMetadata(DiscordRestClient client, Model model) : base(client, model) { Update(model, UpdateSource.Creation); }