-
-
Notifications
You must be signed in to change notification settings - Fork 299
/
DiscordEmbed.cs
96 lines (80 loc) · 3.03 KB
/
DiscordEmbed.cs
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
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace DSharpPlus.Entities;
/// <summary>
/// Represents a discord embed.
/// </summary>
public sealed class DiscordEmbed
{
/// <summary>
/// Gets the embed's title.
/// </summary>
[JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
public string? Title { get; internal set; }
/// <summary>
/// Gets the embed's type.
/// </summary>
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public string? Type { get; internal set; }
/// <summary>
/// Gets the embed's description.
/// </summary>
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
public string? Description { get; internal set; }
/// <summary>
/// Gets the embed's url.
/// </summary>
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
public Uri? Url { get; internal set; }
/// <summary>
/// Gets the embed's timestamp.
/// </summary>
[JsonProperty("timestamp", NullValueHandling = NullValueHandling.Ignore)]
public DateTimeOffset? Timestamp { get; internal set; }
/// <summary>
/// Gets the embed's color.
/// </summary>
[JsonIgnore]
public DiscordColor? Color => this.color.HasValue
? (DiscordColor)this.color.Value
: null;
[JsonProperty("color", NullValueHandling = NullValueHandling.Include)]
internal Optional<int> color;
/// <summary>
/// Gets the embed's footer.
/// </summary>
[JsonProperty("footer", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedFooter? Footer { get; internal set; }
/// <summary>
/// Gets the embed's image.
/// </summary>
[JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedImage? Image { get; internal set; }
/// <summary>
/// Gets the embed's thumbnail.
/// </summary>
[JsonProperty("thumbnail", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedThumbnail? Thumbnail { get; internal set; }
/// <summary>
/// Gets the embed's video.
/// </summary>
[JsonProperty("video", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedVideo? Video { get; internal set; }
/// <summary>
/// Gets the embed's provider.
/// </summary>
[JsonProperty("provider", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedProvider? Provider { get; internal set; }
/// <summary>
/// Gets the embed's author.
/// </summary>
[JsonProperty("author", NullValueHandling = NullValueHandling.Ignore)]
public DiscordEmbedAuthor? Author { get; internal set; }
/// <summary>
/// Gets the embed's fields.
/// </summary>
[JsonProperty("fields", NullValueHandling = NullValueHandling.Ignore)]
public IReadOnlyList<DiscordEmbedField>? Fields { get; internal set; }
internal DiscordEmbed() { }
}