You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

SelectMenuComponent.cs 1.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Discord.API
  8. {
  9. internal class SelectMenuComponent : IMessageComponent
  10. {
  11. [JsonProperty("type")]
  12. public ComponentType Type { get; set; }
  13. [JsonProperty("custom_id")]
  14. public string CustomId { get; set; }
  15. [JsonProperty("options")]
  16. public SelectMenuOption[] Options { get; set; }
  17. [JsonProperty("placeholder")]
  18. public Optional<string> Placeholder { get; set; }
  19. [JsonProperty("min_values")]
  20. public int MinValues { get; set; }
  21. [JsonProperty("max_values")]
  22. public int MaxValues { get; set; }
  23. [JsonProperty("disabled")]
  24. public bool Disabled { get; set; }
  25. public SelectMenuComponent() { }
  26. public SelectMenuComponent(Discord.SelectMenuComponent component)
  27. {
  28. Type = component.Type;
  29. CustomId = component.CustomId;
  30. Options = component.Options.Select(x => new SelectMenuOption(x)).ToArray();
  31. Placeholder = component.Placeholder;
  32. MinValues = component.MinValues;
  33. MaxValues = component.MaxValues;
  34. Disabled = component.Disabled;
  35. }
  36. }
  37. }