diff --git a/src/Discord.Net/Rest/Models/Webhook/Webhook.cs b/src/Discord.Net/Rest/Models/Webhook/Webhook.cs new file mode 100644 index 000000000..08ea61f47 --- /dev/null +++ b/src/Discord.Net/Rest/Models/Webhook/Webhook.cs @@ -0,0 +1,33 @@ +using System.Text.Json.Serialization; + +namespace Discord.Models +{ + public class Webhook + { + public const int MinWebhookNameLength = 2; + public const int MaxWebhookNameLength = 32; + + public const int MinMessageContentLength = 0; + public const int MaxMessageContentLength = 2000; + + public const int MinEmbedLimit = 0; + public const int MaxEmbedLimit = 10; + + [JsonPropertyName("id")] + public Snowflake Id { get; set; } + [JsonPropertyName("type")] + public WebhookType Type { get; set; } + [JsonPropertyName("guild_id")] + public Optional GuildId { get; set; } + [JsonPropertyName("channel_id")] + public Snowflake ChannelId { get; set; } + [JsonPropertyName("user")] + public Optional Creator { get; set; } + [JsonPropertyName("name")] + public string? Name { get; set; } + [JsonPropertyName("avatar")] + public string? AvatarId { get; set; } + [JsonPropertyName("token")] + public Optional Token { get; set; } + } +} diff --git a/src/Discord.Net/Rest/Models/Webhook/WebhookType.cs b/src/Discord.Net/Rest/Models/Webhook/WebhookType.cs new file mode 100644 index 000000000..574d5c9ca --- /dev/null +++ b/src/Discord.Net/Rest/Models/Webhook/WebhookType.cs @@ -0,0 +1,8 @@ +namespace Discord.Models +{ + public enum WebhookType : byte + { + Incoming = 1, + ChannelFollower = 2 + } +}