Exemplo n.º 1
0
        internal static SocketApplicationCommandOption Create(Model model)
        {
            var entity = new SocketApplicationCommandOption();

            entity.Update(model);
            return(entity);
        }
Exemplo n.º 2
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>();
        }
Exemplo n.º 3
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;
        }