Add round end Discord pings, discord webhook API (#19468)
This commit is contained in:
42
Content.Server/Discord/WebhookData.cs
Normal file
42
Content.Server/Discord/WebhookData.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user