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.

CurrentUser.cs 2.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 CurrentUser : User, ICurrentUserModel
  10. {
  11. [JsonProperty("verified")]
  12. public Optional<bool> Verified { get; set; }
  13. [JsonProperty("email")]
  14. public Optional<string> Email { get; set; }
  15. [JsonProperty("mfa_enabled")]
  16. public Optional<bool> MfaEnabled { get; set; }
  17. [JsonProperty("flags")]
  18. public Optional<UserProperties> Flags { get; set; }
  19. [JsonProperty("premium_type")]
  20. public Optional<PremiumType> PremiumType { get; set; }
  21. [JsonProperty("locale")]
  22. public Optional<string> Locale { get; set; }
  23. [JsonProperty("public_flags")]
  24. public Optional<UserProperties> PublicFlags { get; set; }
  25. // ICurrentUserModel
  26. bool? ICurrentUserModel.IsVerified
  27. {
  28. get => Verified.ToNullable();
  29. set => throw new NotSupportedException();
  30. }
  31. string ICurrentUserModel.Email
  32. {
  33. get => Email.GetValueOrDefault();
  34. set => throw new NotSupportedException();
  35. }
  36. bool? ICurrentUserModel.IsMfaEnabled
  37. {
  38. get => MfaEnabled.ToNullable();
  39. set => throw new NotSupportedException();
  40. }
  41. UserProperties ICurrentUserModel.Flags
  42. {
  43. get => Flags.GetValueOrDefault();
  44. set => throw new NotSupportedException();
  45. }
  46. PremiumType ICurrentUserModel.PremiumType
  47. {
  48. get => PremiumType.GetValueOrDefault();
  49. set => throw new NotSupportedException();
  50. }
  51. string ICurrentUserModel.Locale
  52. {
  53. get => Locale.GetValueOrDefault();
  54. set => throw new NotSupportedException();
  55. }
  56. UserProperties ICurrentUserModel.PublicFlags
  57. {
  58. get => PublicFlags.GetValueOrDefault();
  59. set => throw new NotSupportedException();
  60. }
  61. }
  62. }