Beispiel #1
0
        internal void Update(Model model)
        {
            this.ApplicationId = model.ApplicationId;
            this.Description   = model.Description;
            this.Name          = model.Name;
            this.GuildId       = model.GuildId;

            this.Options = model.Options.Any()
                ? model.Options.Select(x => SocketApplicationCommandOption.Create(x)).ToImmutableArray()
                : new ImmutableArray <SocketApplicationCommandOption>();
        }
Beispiel #2
0
        internal void Update(Model model)
        {
            this.Name        = model.Name;
            this.Type        = model.Type;
            this.Description = model.Description;

            this.Default = model.Default.IsSpecified
                ? model.Default.Value
                : (bool?)null;

            this.Required = model.Required.IsSpecified
                ? model.Required.Value
                : (bool?)null;

            this.Choices = model.Choices.IsSpecified
                ? model.Choices.Value.Select(x => SocketApplicationCommandChoice.Create(x)).ToImmutableArray().ToReadOnlyCollection()
                : null;

            this.Options = model.Options.IsSpecified
                ? model.Options.Value.Select(x => SocketApplicationCommandOption.Create(x)).ToImmutableArray().ToReadOnlyCollection()
                : null;
        }