Beispiel #1
0
 internal void Update(Model model)
 {
     GuildId     = model.Guild.Id;
     ChannelId   = model.Channel.Id;
     GuildName   = model.Guild.Name;
     ChannelName = model.Channel.Name;
 }
Beispiel #2
0
        public Invite(DiscordRestClient discord, Model model)
            : base(model.Code)
        {
            Discord = discord;

            Update(model, UpdateSource.Creation);
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
        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;
        }
Beispiel #6
0
 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;
 }
Beispiel #7
0
        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);
        }