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.

ThreadMetadata.cs 1.6 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Text.Json.Serialization;
  3. namespace Discord.Net.Models
  4. {
  5. /// <summary>
  6. /// Represents a discord thread metadata object.
  7. /// </summary>
  8. /// <remarks>
  9. /// <see href="https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure"/>
  10. /// </remarks>
  11. public record ThreadMetadata
  12. {
  13. /// <summary>
  14. /// Whether the thread is archived.
  15. /// </summary>
  16. [JsonPropertyName("archived")]
  17. public bool Archived { get; init; }
  18. /// <summary>
  19. /// Id of the <see cref="User"/> that last archived or unarchived the thread.
  20. /// </summary>
  21. [JsonPropertyName("archiver_id")]
  22. public Optional<Snowflake> ArchiverId { get; init; }
  23. /// <summary>
  24. /// Duration in minutes to automatically archive the thread after
  25. /// recent activity, can be set to: 60, 1440, 4320, 10080.
  26. /// </summary>
  27. [JsonPropertyName("auto_archive_duration")]
  28. public int AutoArchiveDuration { get; init; }
  29. /// <summary>
  30. /// Timestamp when the thread's archive status was last changed, used for
  31. /// calculating recent activity.
  32. /// </summary>
  33. [JsonPropertyName("archive_timestamp")]
  34. public DateTimeOffset ArchiveTimestamp { get; init; }
  35. /// <summary>
  36. /// When a thread is locked, only <see cref="User"/>s with
  37. /// <see cref="Permissions.ManageThreads"/> can unarchive it.
  38. /// </summary>
  39. [JsonPropertyName("locked")]
  40. public Optional<bool> Locked { get; init; }
  41. }
  42. }

No Description