2023-08-24 14:50:07 -07:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Discord;
|
|
|
|
|
|
|
|
|
|
|
|
// https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure
|
|
|
|
|
|
public struct WebhookData
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonPropertyName("id")]
|
2023-08-24 22:59:43 -07:00
|
|
|
|
public string Id { get; set; }
|
2023-08-24 14:50:07 -07:00
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("type")]
|
|
|
|
|
|
public int Type { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("guild_id")]
|
2023-08-24 22:59:43 -07:00
|
|
|
|
public string? GuildId { get; set; }
|
2023-08-24 14:50:07 -07:00
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("channel_id")]
|
2023-08-24 22:59:43 -07:00
|
|
|
|
public string? ChannelId { get; set; }
|
2023-08-24 14:50:07 -07:00
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("user")]
|
|
|
|
|
|
public WebhookUser? User { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("name")]
|
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("avatar")]
|
|
|
|
|
|
public string? Avatar { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("token")]
|
|
|
|
|
|
public string Token { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("application_id")]
|
2023-08-24 22:59:43 -07:00
|
|
|
|
public string? ApplicationId { get; set; }
|
2023-08-24 14:50:07 -07:00
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("url")]
|
|
|
|
|
|
public string? Url { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public WebhookIdentifier ToIdentifier()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new WebhookIdentifier(Id, Token);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|