wabbajack/Wabbajack.Server/DTOs/DiscordMessage.cs

76 lines
2.0 KiB
C#
Raw Normal View History

2022-01-18 21:47:36 +00:00
using System.Text.Json.Serialization;
2021-10-23 16:51:17 +00:00
namespace Wabbajack.Server.DTOs;
public class DiscordMessage
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("username")]
public string? UserName { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("avatar_url")]
public Uri? AvatarUrl { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("content")]
public string? Content { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("embeds")]
public DiscordEmbed[]? Embeds { get; set; }
2021-10-23 16:51:17 +00:00
}
public class DiscordEmbed
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("title")] public string Title { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("color")] public int Color { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("author")] public DiscordAuthor Author { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("url")] public Uri Url { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("description")] public string Description { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("fields")] public DiscordField Field { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("thumbnail")] public DiscordThumbnail Thumbnail { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("image")] public DiscordImage Image { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("footer")] public DiscordFooter Footer { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("timestamp")] public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}
2021-10-23 16:51:17 +00:00
public class DiscordAuthor
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("name")] public string Name { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("url")] public Uri Url { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("icon_url")] public Uri IconUrl { get; set; }
2021-10-23 16:51:17 +00:00
}
public class DiscordField
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("name")] public string Name { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("value")] public string Value { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("inline")] public bool Inline { get; set; }
2021-10-23 16:51:17 +00:00
}
2022-01-18 21:47:36 +00:00
public class DiscordThumbnail
2021-10-23 16:51:17 +00:00
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("Url")] public Uri Url { get; set; }
2021-10-23 16:51:17 +00:00
}
public class DiscordImage
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("Url")] public Uri Url { get; set; }
2021-10-23 16:51:17 +00:00
}
public class DiscordFooter
{
2022-01-18 21:47:36 +00:00
[JsonPropertyName("text")] public string Text { get; set; }
2021-10-23 16:51:17 +00:00
2022-01-18 21:47:36 +00:00
[JsonPropertyName("icon_url")] public Uri icon_url { get; set; }
2021-10-23 16:51:17 +00:00
}