Example #1
0
        internal override void Update(PresenceUpdateModel model)
        {
            base.Update(model);

            if (IsBot)
            {
                _status = model.Status;
                _activity = model.Game != null
                    ? Activity.Create(model.Game)
                    : null;
            }
        }
Example #2
0
        internal override void Update(PresenceUpdateModel model)
        {
            SharedUser.Update(model);

            if (IsBot)
            {
                // Users cannot have different statuses for different guilds
                // due to the lack of sharding support.
                _presence = model.Status != UserStatus.Offline
                    ? new Presence(true, model)
                    : null;
            }
        }
Example #3
0
        internal Presence(bool isBot, PresenceUpdateModel model)
        {
            Status   = model.Status;
            Activity = model.Game != null
                ? Activity.Create(model.Game)
                : null;

            if (!isBot)
            {
                _statuses   = model.ClientStatus.ReadOnly();
                _activities = model.Game != null
                    ? model.Activities.ToReadOnlyList(x => Activity.Create(x))
                    : ReadOnlyList <Activity> .Empty;
            }
        }
Example #4
0
 internal override void Update(PresenceUpdateModel model)
 => throw new InvalidOperationException();
Example #5
0
 internal virtual void Update(PresenceUpdateModel model)
 => SharedUser.Update(model);