Exemple #1
0
        public void Update(GuildScheduledEventJsonModel model)
        {
            if (model.Creator.HasValue)
            {
                Creator = new TransientUser(Client, model.Creator.Value);
            }

            ChannelId      = model.ChannelId;
            Name           = model.Name;
            Description    = model.Description.Value;
            CoverImageHash = model.Image;
            StartsAt       = model.ScheduledStartTime;
            EndsAt         = model.ScheduledEndTime;
            PrivacyLevel   = model.PrivacyLevel;
            Status         = model.Status;
            TargetType     = model.EntityType;
            TargetId       = model.EntityId;

            if (model.EntityMetadata != null)
            {
                Metadata = new TransientGuildEventMetadata(model.EntityMetadata);
            }

            SubscriberCount = model.UserCount.GetValueOrNullable();
        }
Exemple #2
0
        public CachedGuildEvent(IGatewayClient client, GuildScheduledEventJsonModel model)
            : base(client, model.Id)
        {
            GuildId   = model.GuildId;
            CreatorId = model.CreatorId;

            Update(model);
        }