From c05a2b2f4d4d405e4187da298ffd821302975839 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:33:49 +0200 Subject: [PATCH 01/13] Added documentation to embed component files. --- NetCord/EmbedAuthor.cs | 21 +++++++++++++++++++-- NetCord/EmbedField.cs | 15 ++++++++++++++- NetCord/EmbedFooter.cs | 15 ++++++++++++++- NetCord/EmbedImage.cs | 18 ++++++++++++++++++ NetCord/EmbedProvider.cs | 11 ++++++++++- NetCord/EmbedThumbnail.cs | 19 ++++++++++++++++++- NetCord/EmbedVideo.cs | 19 ++++++++++++++++++- 7 files changed, 111 insertions(+), 7 deletions(-) diff --git a/NetCord/EmbedAuthor.cs b/NetCord/EmbedAuthor.cs index e1db15a46..7d60c7da3 100644 --- a/NetCord/EmbedAuthor.cs +++ b/NetCord/EmbedAuthor.cs @@ -1,17 +1,34 @@ namespace NetCord; +/// +/// Contains information about the author of an embed, used to render the author block. +/// public class EmbedAuthor : IJsonModel { JsonModels.JsonEmbedAuthor IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedAuthor _jsonModel; - public EmbedAuthor(JsonModels.JsonEmbedAuthor jsonModel) { _jsonModel = jsonModel; } - + + /// + /// The name of the author, displayed next to the icon if one is specified in . + /// public string? Name => _jsonModel.Name; + + /// + /// When set, turns the into a clickable link, pointing to the specified URL. + /// public string? Url => _jsonModel.Url; + + /// + /// Points to an image, which is displayed in a small circular format to the left of the . + /// public string? IconUrl => _jsonModel.IconUrl; + + /// + /// The URL of the icon image, proxied by the discord CDN server. + /// public string? ProxyIconUrl => _jsonModel.ProxyIconUrl; } diff --git a/NetCord/EmbedField.cs b/NetCord/EmbedField.cs index d4adc3174..49c4b74cc 100644 --- a/NetCord/EmbedField.cs +++ b/NetCord/EmbedField.cs @@ -1,16 +1,29 @@ namespace NetCord; +/// +/// Contains information about an embed field, of which a maximum of 25 can be set per embed. +/// public class EmbedField : IJsonModel { JsonModels.JsonEmbedField IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedField _jsonModel; - public EmbedField(JsonModels.JsonEmbedField jsonModel) { _jsonModel = jsonModel; } + /// + /// Equivalent to but localised to a field, limited to 256 characters. + /// public string Name => _jsonModel.Name; + + /// + /// Equivalent to but localised to a field, limited to 1024 characters. + /// + public string Value => _jsonModel.Value; + /// + /// When set alongside another field with set, displays the fields side by side. + /// public bool Inline => _jsonModel.Inline; } diff --git a/NetCord/EmbedFooter.cs b/NetCord/EmbedFooter.cs index 01e318d1d..608e5b4ae 100644 --- a/NetCord/EmbedFooter.cs +++ b/NetCord/EmbedFooter.cs @@ -1,16 +1,29 @@ namespace NetCord; +/// +/// Contains information used to render the footer block of an embed. +/// public class EmbedFooter : IJsonModel { JsonModels.JsonEmbedFooter IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedFooter _jsonModel; - public EmbedFooter(JsonModels.JsonEmbedFooter jsonModel) { _jsonModel = jsonModel; } + /// + /// The text displayed in the footer, to the right of the icon if one is set, limited to 2048 characters. + /// public string Text => _jsonModel.Text; + + /// + /// Points to an image, which is displayed in a small circular format to the left of the . + /// public string? IconUrl => _jsonModel.IconUrl; + + /// + /// The URL of the icon image, proxied by the discord CDN server. + /// public string? ProxyIconUrl => _jsonModel.ProxyIconUrl; } diff --git a/NetCord/EmbedImage.cs b/NetCord/EmbedImage.cs index 13e49e92e..5574acfe4 100644 --- a/NetCord/EmbedImage.cs +++ b/NetCord/EmbedImage.cs @@ -1,5 +1,8 @@ namespace NetCord; +/// +/// Contains information used for the rendering and display of images in embeds. +/// public class EmbedImage : IJsonModel { JsonModels.JsonEmbedImage IJsonModel.JsonModel => _jsonModel; @@ -10,8 +13,23 @@ public EmbedImage(JsonModels.JsonEmbedImage jsonModel) _jsonModel = jsonModel; } + /// + /// The URL of the image displayed in the embed. + /// public string? Url => _jsonModel.Url; + + /// + /// The URL of the image, proxied by the discord CDN server. + /// public string? ProxyUrl => _jsonModel.ProxyUrl; + + /// + /// The height of the image in pixels. + /// public int? Height => _jsonModel.Height; + + /// + /// The width of the image in pixels. + /// public int? Width => _jsonModel.Width; } diff --git a/NetCord/EmbedProvider.cs b/NetCord/EmbedProvider.cs index 1830e1557..555bd43ae 100644 --- a/NetCord/EmbedProvider.cs +++ b/NetCord/EmbedProvider.cs @@ -1,15 +1,24 @@ namespace NetCord; +/// +/// Contains information used to display the provider tag at the top of an embed. +/// public class EmbedProvider : IJsonModel { JsonModels.JsonEmbedProvider IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedProvider _jsonModel; - public EmbedProvider(JsonModels.JsonEmbedProvider jsonModel) { _jsonModel = jsonModel; } + /// + /// The name of the provider, displayed at the top of the embed. + /// public string? Name => _jsonModel.Name; + + /// + /// When set, turns the into a clickable link, pointing to the specified URL. + /// public string? Url => _jsonModel.Url; } diff --git a/NetCord/EmbedThumbnail.cs b/NetCord/EmbedThumbnail.cs index dd7f4008e..38ac9b90a 100644 --- a/NetCord/EmbedThumbnail.cs +++ b/NetCord/EmbedThumbnail.cs @@ -1,17 +1,34 @@ namespace NetCord; +/// +/// Contains information used for the rendering and display of thumbnails in embeds. +/// public class EmbedThumbnail : IJsonModel { JsonModels.JsonEmbedThumbnail IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedThumbnail _jsonModel; - public EmbedThumbnail(JsonModels.JsonEmbedThumbnail jsonModel) { _jsonModel = jsonModel; } + /// + /// The URL of the image displayed as the thumbnail in the embed. + /// public string? Url => _jsonModel.Url; + + /// + /// The URL of the image displayed as the thumbnail in the embed, proxied by the discord CDN server. + /// public string? ProxyUrl => _jsonModel.ProxyUrl; + + /// + /// The height of the image in pixels. + /// public int? Height => _jsonModel.Height; + + /// + /// The width of the image in pixels. + /// public int? Width => _jsonModel.Width; } diff --git a/NetCord/EmbedVideo.cs b/NetCord/EmbedVideo.cs index c2551072d..2d3c9f1e5 100644 --- a/NetCord/EmbedVideo.cs +++ b/NetCord/EmbedVideo.cs @@ -1,17 +1,34 @@ namespace NetCord; +/// +/// Contains information used for the rendering and display of videos in embeds. +/// public class EmbedVideo : IJsonModel { JsonModels.JsonEmbedVideo IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbedVideo _jsonModel; - public EmbedVideo(JsonModels.JsonEmbedVideo jsonModel) { _jsonModel = jsonModel; } + /// + /// The URL of the video displayed in the embed. + /// public string? Url => _jsonModel.Url; + + /// + /// The URL of the video displayed in the embed, proxied by the discord CDN server. + /// public string? ProxyUrl => _jsonModel.ProxyUrl; + + /// + /// The height of the video in pixels. + /// public int? Height => _jsonModel.Height; + + /// + /// The width of the video in pixels. + /// public int? Width => _jsonModel.Width; } From 105ee5edd897b75b4e86a942b660cc680de0972b Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:47:22 +0200 Subject: [PATCH 02/13] Extra tag removed Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/EmbedField.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/EmbedField.cs b/NetCord/EmbedField.cs index 49c4b74cc..7f1281ae1 100644 --- a/NetCord/EmbedField.cs +++ b/NetCord/EmbedField.cs @@ -22,6 +22,7 @@ public EmbedField(JsonModels.JsonEmbedField jsonModel) /// public string Value => _jsonModel.Value; + /// /// When set alongside another field with set, displays the fields side by side. /// From 89bfcec0950a97ce8adb62e3c93532a97ea2cdd6 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:48:20 +0200 Subject: [PATCH 03/13] Extra newline removed Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/EmbedField.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/NetCord/EmbedField.cs b/NetCord/EmbedField.cs index 7f1281ae1..4e32a2cec 100644 --- a/NetCord/EmbedField.cs +++ b/NetCord/EmbedField.cs @@ -20,7 +20,6 @@ public EmbedField(JsonModels.JsonEmbedField jsonModel) /// /// Equivalent to but localised to a field, limited to 1024 characters. /// - public string Value => _jsonModel.Value; /// From e6a45b3842ca9399ccff6f0b620104cfc7667a5e Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:49:44 +0200 Subject: [PATCH 04/13] Grammar fix --- NetCord/EmbedAuthor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedAuthor.cs b/NetCord/EmbedAuthor.cs index 7d60c7da3..ba7eabec3 100644 --- a/NetCord/EmbedAuthor.cs +++ b/NetCord/EmbedAuthor.cs @@ -28,7 +28,7 @@ public EmbedAuthor(JsonModels.JsonEmbedAuthor jsonModel) public string? IconUrl => _jsonModel.IconUrl; /// - /// The URL of the icon image, proxied by the discord CDN server. + /// The URL of the icon image, proxied by the Discord CDN server. /// public string? ProxyIconUrl => _jsonModel.ProxyIconUrl; } From 050b9703c358a57efebed7344247a95361d48e7c Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:50:21 +0200 Subject: [PATCH 05/13] Grammatical fix --- NetCord/EmbedFooter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedFooter.cs b/NetCord/EmbedFooter.cs index 608e5b4ae..4ffa39e91 100644 --- a/NetCord/EmbedFooter.cs +++ b/NetCord/EmbedFooter.cs @@ -23,7 +23,7 @@ public EmbedFooter(JsonModels.JsonEmbedFooter jsonModel) public string? IconUrl => _jsonModel.IconUrl; /// - /// The URL of the icon image, proxied by the discord CDN server. + /// The URL of the icon image, proxied by the Discord CDN server. /// public string? ProxyIconUrl => _jsonModel.ProxyIconUrl; } From 05b33e8c2d9e046fbcb7c5d905b74e4d45b5cec0 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:51:14 +0200 Subject: [PATCH 06/13] Grammar fix --- NetCord/EmbedImage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedImage.cs b/NetCord/EmbedImage.cs index 5574acfe4..cd293368e 100644 --- a/NetCord/EmbedImage.cs +++ b/NetCord/EmbedImage.cs @@ -19,7 +19,7 @@ public EmbedImage(JsonModels.JsonEmbedImage jsonModel) public string? Url => _jsonModel.Url; /// - /// The URL of the image, proxied by the discord CDN server. + /// The URL of the image, proxied by the Discord CDN server. /// public string? ProxyUrl => _jsonModel.ProxyUrl; From 762d7c3cea7e5f275b3ffee75e4f27eb613ac9f9 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:52:39 +0200 Subject: [PATCH 07/13] Gr --- NetCord/EmbedThumbnail.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedThumbnail.cs b/NetCord/EmbedThumbnail.cs index 38ac9b90a..124f6afb6 100644 --- a/NetCord/EmbedThumbnail.cs +++ b/NetCord/EmbedThumbnail.cs @@ -18,7 +18,7 @@ public EmbedThumbnail(JsonModels.JsonEmbedThumbnail jsonModel) public string? Url => _jsonModel.Url; /// - /// The URL of the image displayed as the thumbnail in the embed, proxied by the discord CDN server. + /// The URL of the image displayed as the thumbnail in the embed, proxied by the Discord CDN server. /// public string? ProxyUrl => _jsonModel.ProxyUrl; From 9190530561cfed5dedd96b3be58fd4d2845ff12c Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:53:11 +0200 Subject: [PATCH 08/13] Grammar fix --- NetCord/EmbedVideo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedVideo.cs b/NetCord/EmbedVideo.cs index 2d3c9f1e5..03d17935e 100644 --- a/NetCord/EmbedVideo.cs +++ b/NetCord/EmbedVideo.cs @@ -18,7 +18,7 @@ public EmbedVideo(JsonModels.JsonEmbedVideo jsonModel) public string? Url => _jsonModel.Url; /// - /// The URL of the video displayed in the embed, proxied by the discord CDN server. + /// The URL of the video displayed in the embed, proxied by the Discord CDN server. /// public string? ProxyUrl => _jsonModel.ProxyUrl; From 63ec0f4a9665cbf9f872e8bbbccdd7ebd40ae5f2 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:55:44 +0200 Subject: [PATCH 09/13] Clarification on URL wording Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/EmbedProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedProvider.cs b/NetCord/EmbedProvider.cs index 555bd43ae..a3336a572 100644 --- a/NetCord/EmbedProvider.cs +++ b/NetCord/EmbedProvider.cs @@ -18,7 +18,7 @@ public EmbedProvider(JsonModels.JsonEmbedProvider jsonModel) public string? Name => _jsonModel.Name; /// - /// When set, turns the into a clickable link, pointing to the specified URL. + /// When set, turns the into a clickable link, pointing to the base of the specified URL. /// public string? Url => _jsonModel.Url; } From 2df7259bc5980051112d518bf7714f38de76b794 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:56:45 +0200 Subject: [PATCH 10/13] Clarification of URL wording --- NetCord/EmbedAuthor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedAuthor.cs b/NetCord/EmbedAuthor.cs index ba7eabec3..365a0c07c 100644 --- a/NetCord/EmbedAuthor.cs +++ b/NetCord/EmbedAuthor.cs @@ -18,7 +18,7 @@ public EmbedAuthor(JsonModels.JsonEmbedAuthor jsonModel) public string? Name => _jsonModel.Name; /// - /// When set, turns the into a clickable link, pointing to the specified URL. + /// When set, turns the into a clickable link, pointing to the base of the specified URL. /// public string? Url => _jsonModel.Url; From 26a4e12628587ebb45d05d0b1bb2d9ef40efbc28 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:22:32 +0200 Subject: [PATCH 11/13] Reverted documentation --- NetCord/EmbedProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedProvider.cs b/NetCord/EmbedProvider.cs index a3336a572..555bd43ae 100644 --- a/NetCord/EmbedProvider.cs +++ b/NetCord/EmbedProvider.cs @@ -18,7 +18,7 @@ public EmbedProvider(JsonModels.JsonEmbedProvider jsonModel) public string? Name => _jsonModel.Name; /// - /// When set, turns the into a clickable link, pointing to the base of the specified URL. + /// When set, turns the into a clickable link, pointing to the specified URL. /// public string? Url => _jsonModel.Url; } From deadab5a9e8430b9380890f37dad9adab828236d Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:27:43 +0200 Subject: [PATCH 12/13] Reverted reverted documentation --- NetCord/EmbedProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedProvider.cs b/NetCord/EmbedProvider.cs index 555bd43ae..a3336a572 100644 --- a/NetCord/EmbedProvider.cs +++ b/NetCord/EmbedProvider.cs @@ -18,7 +18,7 @@ public EmbedProvider(JsonModels.JsonEmbedProvider jsonModel) public string? Name => _jsonModel.Name; /// - /// When set, turns the into a clickable link, pointing to the specified URL. + /// When set, turns the into a clickable link, pointing to the base of the specified URL. /// public string? Url => _jsonModel.Url; } From 6445ddce228091eb0e80e481f99f7a7fe09d0b80 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:28:18 +0200 Subject: [PATCH 13/13] Properly reverted documentation --- NetCord/EmbedAuthor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/EmbedAuthor.cs b/NetCord/EmbedAuthor.cs index 365a0c07c..ba7eabec3 100644 --- a/NetCord/EmbedAuthor.cs +++ b/NetCord/EmbedAuthor.cs @@ -18,7 +18,7 @@ public EmbedAuthor(JsonModels.JsonEmbedAuthor jsonModel) public string? Name => _jsonModel.Name; /// - /// When set, turns the into a clickable link, pointing to the base of the specified URL. + /// When set, turns the into a clickable link, pointing to the specified URL. /// public string? Url => _jsonModel.Url;