WebhookPayload.cs 789 B

1234567891011121314151617181920212223242526272829
  1. using System.Text.Json.Serialization;
  2. namespace Content.Server.Discord;
  3. // https://discord.com/developers/docs/resources/channel#message-object-message-structure
  4. public struct WebhookPayload
  5. {
  6. /// <summary>
  7. /// The message to send in the webhook. Maximum of 2000 characters.
  8. /// </summary>
  9. [JsonPropertyName("content")]
  10. public string? Content { get; set; }
  11. [JsonPropertyName("username")]
  12. public string? Username { get; set; }
  13. [JsonPropertyName("avatar_url")]
  14. public string? AvatarUrl { get; set; }
  15. [JsonPropertyName("embeds")]
  16. public List<WebhookEmbed>? Embeds { get; set; } = null;
  17. [JsonPropertyName("allowed_mentions")]
  18. public WebhookMentions AllowedMentions { get; set; } = new();
  19. public WebhookPayload()
  20. {
  21. }
  22. }