Add round end Discord pings, discord webhook API (#19468)

This commit is contained in:
DrSmugleaf
2023-08-24 14:50:07 -07:00
committed by GitHub
parent 7ecdb937ac
commit 913c80db4a
13 changed files with 390 additions and 72 deletions

View File

@@ -0,0 +1,42 @@
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")]
public ulong Id { get; set; }
[JsonPropertyName("type")]
public int Type { get; set; }
[JsonPropertyName("guild_id")]
public ulong? GuildId { get; set; }
[JsonPropertyName("channel_id")]
public ulong? ChannelId { get; set; }
[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")]
public ulong? ApplicationId { get; set; }
[JsonPropertyName("url")]
public string? Url { get; set; }
public WebhookIdentifier ToIdentifier()
{
return new WebhookIdentifier(Id, Token);
}
}