Skip to content
21 changes: 19 additions & 2 deletions NetCord/EmbedAuthor.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
namespace NetCord;

/// <summary>
/// Contains information about the author of an embed, used to render the author block.
/// </summary>
public class EmbedAuthor : IJsonModel<JsonModels.JsonEmbedAuthor>
{
JsonModels.JsonEmbedAuthor IJsonModel<JsonModels.JsonEmbedAuthor>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedAuthor _jsonModel;

public EmbedAuthor(JsonModels.JsonEmbedAuthor jsonModel)
{
_jsonModel = jsonModel;
}


/// <summary>
/// The name of the author, displayed next to the icon if one is specified in <see cref="IconUrl"/>.
/// </summary>
public string? Name => _jsonModel.Name;

/// <summary>
/// When set, turns the <see cref="Name"/> into a clickable link, pointing to the specified URL.
/// </summary>
public string? Url => _jsonModel.Url;

/// <summary>
/// Points to an image, which is displayed in a small circular format to the left of the <see cref="Name"/>.
/// </summary>
public string? IconUrl => _jsonModel.IconUrl;

/// <summary>
/// The URL of the icon image, proxied by the discord CDN server.
/// </summary>
public string? ProxyIconUrl => _jsonModel.ProxyIconUrl;
}
15 changes: 14 additions & 1 deletion NetCord/EmbedField.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
namespace NetCord;

/// <summary>
/// Contains information about an embed field, of which a maximum of 25 can be set per embed.
/// </summary>
public class EmbedField : IJsonModel<JsonModels.JsonEmbedField>
{
JsonModels.JsonEmbedField IJsonModel<JsonModels.JsonEmbedField>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedField _jsonModel;

public EmbedField(JsonModels.JsonEmbedField jsonModel)
{
_jsonModel = jsonModel;
}

/// <summary>
/// Equivalent to <see cref="Embed.Title"/> but localised to a field, limited to 256 characters.
/// </summary>
public string Name => _jsonModel.Name;

/// <summary>
/// Equivalent to <see cref="Embed.Description"/> but localised to a field, limited to 1024 characters.
/// </summary>

Comment thread
Red-K0 marked this conversation as resolved.
Outdated
public string Value => _jsonModel.Value;
/// <summary>
Comment thread
Red-K0 marked this conversation as resolved.
/// When set alongside another field with <see cref="Inline"/> set, displays the fields side by side.
/// </summary>
public bool Inline => _jsonModel.Inline;
}
15 changes: 14 additions & 1 deletion NetCord/EmbedFooter.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
namespace NetCord;

/// <summary>
/// Contains information used to render the footer block of an embed.
/// </summary>
public class EmbedFooter : IJsonModel<JsonModels.JsonEmbedFooter>
{
JsonModels.JsonEmbedFooter IJsonModel<JsonModels.JsonEmbedFooter>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedFooter _jsonModel;

public EmbedFooter(JsonModels.JsonEmbedFooter jsonModel)
{
_jsonModel = jsonModel;
}

/// <summary>
/// The text displayed in the footer, to the right of the icon if one is set, limited to 2048 characters.
/// </summary>
public string Text => _jsonModel.Text;

/// <summary>
/// Points to an image, which is displayed in a small circular format to the left of the <see cref="Text"/>.
/// </summary>
public string? IconUrl => _jsonModel.IconUrl;

/// <summary>
/// The URL of the icon image, proxied by the discord CDN server.
/// </summary>
public string? ProxyIconUrl => _jsonModel.ProxyIconUrl;
}
18 changes: 18 additions & 0 deletions NetCord/EmbedImage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace NetCord;

/// <summary>
/// Contains information used for the rendering and display of images in embeds.
/// </summary>
public class EmbedImage : IJsonModel<JsonModels.JsonEmbedImage>
{
JsonModels.JsonEmbedImage IJsonModel<JsonModels.JsonEmbedImage>.JsonModel => _jsonModel;
Expand All @@ -10,8 +13,23 @@ public EmbedImage(JsonModels.JsonEmbedImage jsonModel)
_jsonModel = jsonModel;
}

/// <summary>
/// The URL of the image displayed in the embed.
/// </summary>
public string? Url => _jsonModel.Url;

/// <summary>
/// The URL of the image, proxied by the discord CDN server.
/// </summary>
public string? ProxyUrl => _jsonModel.ProxyUrl;

/// <summary>
/// The height of the image in pixels.
/// </summary>
public int? Height => _jsonModel.Height;

/// <summary>
/// The width of the image in pixels.
/// </summary>
public int? Width => _jsonModel.Width;
}
11 changes: 10 additions & 1 deletion NetCord/EmbedProvider.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
namespace NetCord;

/// <summary>
/// Contains information used to display the provider tag at the top of an embed.
/// </summary>
public class EmbedProvider : IJsonModel<JsonModels.JsonEmbedProvider>
{
JsonModels.JsonEmbedProvider IJsonModel<JsonModels.JsonEmbedProvider>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedProvider _jsonModel;

public EmbedProvider(JsonModels.JsonEmbedProvider jsonModel)
{
_jsonModel = jsonModel;
}

/// <summary>
/// The name of the provider, displayed at the top of the embed.
/// </summary>
public string? Name => _jsonModel.Name;

/// <summary>
/// When set, turns the <see cref="Name"/> into a clickable link, pointing to the specified URL.
Comment thread
Red-K0 marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have reverted a wrong line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the revert and reverted the correct one (sorry about that lol)

/// </summary>
public string? Url => _jsonModel.Url;
}
19 changes: 18 additions & 1 deletion NetCord/EmbedThumbnail.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
namespace NetCord;

/// <summary>
/// Contains information used for the rendering and display of thumbnails in embeds.
/// </summary>
public class EmbedThumbnail : IJsonModel<JsonModels.JsonEmbedThumbnail>
{
JsonModels.JsonEmbedThumbnail IJsonModel<JsonModels.JsonEmbedThumbnail>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedThumbnail _jsonModel;

public EmbedThumbnail(JsonModels.JsonEmbedThumbnail jsonModel)
{
_jsonModel = jsonModel;
}

/// <summary>
/// The URL of the image displayed as the thumbnail in the embed.
/// </summary>
public string? Url => _jsonModel.Url;

/// <summary>
/// The URL of the image displayed as the thumbnail in the embed, proxied by the discord CDN server.
/// </summary>
public string? ProxyUrl => _jsonModel.ProxyUrl;

/// <summary>
/// The height of the image in pixels.
/// </summary>
public int? Height => _jsonModel.Height;

/// <summary>
/// The width of the image in pixels.
/// </summary>
public int? Width => _jsonModel.Width;
}
19 changes: 18 additions & 1 deletion NetCord/EmbedVideo.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
namespace NetCord;

/// <summary>
/// Contains information used for the rendering and display of videos in embeds.
/// </summary>
public class EmbedVideo : IJsonModel<JsonModels.JsonEmbedVideo>
{
JsonModels.JsonEmbedVideo IJsonModel<JsonModels.JsonEmbedVideo>.JsonModel => _jsonModel;
private readonly JsonModels.JsonEmbedVideo _jsonModel;

public EmbedVideo(JsonModels.JsonEmbedVideo jsonModel)
{
_jsonModel = jsonModel;
}

/// <summary>
/// The URL of the video displayed in the embed.
/// </summary>
public string? Url => _jsonModel.Url;

/// <summary>
/// The URL of the video displayed in the embed, proxied by the discord CDN server.
/// </summary>
public string? ProxyUrl => _jsonModel.ProxyUrl;

/// <summary>
/// The height of the video in pixels.
/// </summary>
public int? Height => _jsonModel.Height;

/// <summary>
/// The width of the video in pixels.
/// </summary>
public int? Width => _jsonModel.Width;
}