Browse Source

Add EmbedType enum

tags/1.0
Christopher F 8 years ago
parent
commit
0708bc5d48
5 changed files with 18 additions and 7 deletions
  1. +3
    -3
      src/Discord.Net.Core/Entities/Messages/Embed.cs
  2. +11
    -0
      src/Discord.Net.Core/Entities/Messages/EmbedType.cs
  3. +1
    -1
      src/Discord.Net.Core/Entities/Messages/IEmbed.cs
  4. +2
    -2
      src/Discord.Net.Rest/API/Common/Embed.cs
  5. +1
    -1
      src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs

+ 3
- 3
src/Discord.Net.Core/Entities/Messages/Embed.cs View File

@@ -7,7 +7,7 @@ namespace Discord
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class Embed : IEmbed
{
public string Type { get; }
public EmbedType Type { get; }

public string Description { get; internal set; }
public string Url { get; internal set; }
@@ -22,12 +22,12 @@ namespace Discord
public EmbedThumbnail? Thumbnail { get; internal set; }
public ImmutableArray<EmbedField> Fields { get; internal set; }

internal Embed(string type)
internal Embed(EmbedType type)
{
Type = type;
Fields = ImmutableArray.Create<EmbedField>();
}
internal Embed(string type,
internal Embed(EmbedType type,
string title,
string description,
string url,


+ 11
- 0
src/Discord.Net.Core/Entities/Messages/EmbedType.cs View File

@@ -0,0 +1,11 @@
namespace Discord
{
public enum EmbedType
{
Rich,
Link,
Video,
Image,
Gifv
}
}

+ 1
- 1
src/Discord.Net.Core/Entities/Messages/IEmbed.cs View File

@@ -6,9 +6,9 @@ namespace Discord
public interface IEmbed
{
string Url { get; }
string Type { get; }
string Title { get; }
string Description { get; }
EmbedType Type { get; }
DateTimeOffset? Timestamp { get; }
Color? Color { get; }
EmbedImage? Image { get; }


+ 2
- 2
src/Discord.Net.Rest/API/Common/Embed.cs View File

@@ -8,14 +8,14 @@ namespace Discord.API
{
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("type")]
public string Type { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
[JsonProperty("color")]
public uint? Color { get; set; }
[JsonProperty("type")]
public EmbedType Type { get; set; }
[JsonProperty("timestamp")]
public DateTimeOffset? Timestamp { get; set; }
[JsonProperty("author")]


+ 1
- 1
src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs View File

@@ -10,7 +10,7 @@ namespace Discord

public EmbedBuilder()
{
_embed = new Embed("rich");
_embed = new Embed(EmbedType.Rich);
Fields = new List<EmbedFieldBuilder>();
}



Loading…
Cancel
Save