internal void Update(Model model) { GuildId = model.Guild.Id; ChannelId = model.Channel.Id; GuildName = model.Guild.Name; ChannelName = model.Channel.Name; }
public Invite(DiscordRestClient discord, Model model) : base(model.Code) { Discord = discord; Update(model, UpdateSource.Creation); }
internal void Update(Model model) { GuildId = model.Guild.Id; ChannelId = model.Channel.Id; GuildName = model.Guild.Name; ChannelName = model.Channel.Name; MemberCount = model.MemberCount.IsSpecified ? model.MemberCount.Value : null; PresenceCount = model.PresenceCount.IsSpecified ? model.PresenceCount.Value : null; }
internal void Update(Model model) { GuildId = model.Guild.IsSpecified ? model.Guild.Value.Id : default(ulong?); ChannelId = model.Channel.Id; GuildName = model.Guild.IsSpecified ? model.Guild.Value.Name : null; ChannelName = model.Channel.Name; MemberCount = model.MemberCount.IsSpecified ? model.MemberCount.Value : null; PresenceCount = model.PresenceCount.IsSpecified ? model.PresenceCount.Value : null; ChannelType = (ChannelType)model.Channel.Type; }
public void Update(Model model, UpdateSource source) { if (source == UpdateSource.Rest && IsAttached) { return; } GuildId = model.Guild.Id; ChannelId = model.Channel.Id; GuildName = model.Guild.Name; ChannelName = model.Channel.Name; }
internal void Update(Model model) { GuildId = model.Guild.IsSpecified ? model.Guild.Value.Id : default(ulong?); ChannelId = model.Channel.Id; GuildName = model.Guild.IsSpecified ? model.Guild.Value.Name : null; ChannelName = model.Channel.Name; MemberCount = model.MemberCount.IsSpecified ? model.MemberCount.Value : null; PresenceCount = model.PresenceCount.IsSpecified ? model.PresenceCount.Value : null; ChannelType = (ChannelType)model.Channel.Type; Inviter = model.Inviter.IsSpecified ? RestUser.Create(Discord, model.Inviter.Value) : null; TargetUser = model.TargetUser.IsSpecified ? RestUser.Create(Discord, model.TargetUser.Value) : null; TargetUserType = model.TargetUserType.IsSpecified ? model.TargetUserType.Value : TargetUserType.Undefined; }
internal static RestInvite Create(BaseDiscordClient discord, IGuild guild, IChannel channel, Model model) { var entity = new RestInvite(discord, guild, channel, model.Code); entity.Update(model); return(entity); }