-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathEmbed.cs
More file actions
142 lines (127 loc) · 3.6 KB
/
Embed.cs
File metadata and controls
142 lines (127 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace DiscordWebhook
{
[JsonObject]
public class Embed : IEmbedUrl
{
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("type")]
public string Type { get; set; } = "rich";
[JsonProperty("description")]
public string Description { get; set; }
public string Url { get; set; }
[JsonProperty("timestamp")]
public DateTimeOffset? TimeStamp { get; set; }
[JsonProperty("color")]
public int Color { get; set; }
[JsonProperty("footer")]
public EmbedFooter Footer { get; set; }
[JsonProperty("image")]
public EmbedImage Image { get; set; }
[JsonProperty("thumbnail")]
public EmbedThumbnail Thumbnail { get; set; }
[JsonProperty("video")]
public EmbedVideo Video { get; set; }
[JsonProperty("provider")]
public EmbedProvider Provider { get; set; }
[JsonProperty("author")]
public EmbedAuthor Author { get; set; }
[JsonProperty("fields")]
public List<EmbedField> Fields { get; set; } = new List<EmbedField>();
}
[JsonObject]
public class EmbedFooter : IEmbedIconUrl, IEmbedIconProxyUrl
{
[JsonProperty("text")]
public string Text { get; set; }
public string IconUrl { get; set; }
public string ProxyIconUrl { get; set; }
}
[JsonObject]
public class EmbedImage : EmbedProxyUrl, IEmbedDimension
{
public int Height { get; set; }
public int Width { get; set; }
}
[JsonObject]
public class EmbedThumbnail : EmbedProxyUrl, IEmbedDimension
{
public int Height { get; set; }
public int Width { get; set; }
}
[JsonObject]
public class EmbedVideo : EmbedUrl, IEmbedDimension
{
public int Height { get; set; }
public int Width { get; set; }
}
[JsonObject]
public class EmbedProvider : EmbedUrl
{
[JsonProperty("name")]
public string Name { get; set; }
}
[JsonObject]
public class EmbedAuthor : EmbedUrl, IEmbedIconUrl, IEmbedIconProxyUrl
{
[JsonProperty("name")]
public string Name { get; set; }
public string IconUrl { get; set; }
public string ProxyIconUrl { get; set; }
}
[JsonObject]
public class EmbedField
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("value")]
public string Value { get; set; }
[JsonProperty("inline")]
public bool Inline { get; set; }
}
[JsonObject]
public abstract class EmbedUrl : IEmbedUrl
{
public string Url { get; set; }
}
[JsonObject]
public abstract class EmbedProxyUrl : EmbedUrl, IEmbedProxyUrl
{
public string ProxyUrl { get; set; }
}
[JsonObject]
public interface IEmbedUrl
{
[JsonProperty("url")]
string Url { get; set; }
}
[JsonObject]
public interface IEmbedProxyUrl
{
[JsonProperty("proxy_url")]
string ProxyUrl { get; set; }
}
[JsonObject]
public interface IEmbedIconUrl
{
[JsonProperty("icon_url")]
string IconUrl { get; set; }
}
[JsonObject]
public interface IEmbedIconProxyUrl
{
[JsonProperty("proxy_icon_url")]
string ProxyIconUrl { get; set; }
}
[JsonObject]
public interface IEmbedDimension
{
[JsonProperty("height")]
int Height { get; set; }
[JsonProperty("width")]
int Width { get; set; }
}
}