From f71cc556009caa34a11fbaadd34ed15ee5b9fec3 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 21:26:43 +0200 Subject: [PATCH 01/15] Added XML documentation for Embed.cs, first of many --- NetCord/Embed.cs | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 5d5679b31..8deb2d92c 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -1,24 +1,66 @@ namespace NetCord; - +/// +/// Displays embedded content such as an image or URL, alongside a title and various other fields. All text in the embed must add up to under 6000 characters, and you can only have up to 10 embed per message. +/// public class Embed : IJsonModel { JsonModels.JsonEmbed IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbed _jsonModel; - + /// + /// The text that is placed above the description, usually highlighted. Also directs to a URL if given, has a 256 character limit. + /// public string? Title => _jsonModel.Title; + /// + /// The type of the embed, always set to for webhook embeds. . + /// public EmbedType? Type => _jsonModel.Type; + /// + /// The part of the embed where most of the text is contained, limited to 4096 characters. + /// public string? Description => _jsonModel.Description; + /// + /// The link to the address of the webpage. Mostly used with the thumbnail, icon and author elements in order to link to an image. + /// public string? Url => _jsonModel.Url; + /// + /// Time that the embed was posted. Located next to the footer. + /// public DateTimeOffset? Timestamp => _jsonModel.Timestamp; + /// + /// Color of your embed’s border, usually in hexadecimal or decimal, specified by an integer between 0x000000 and 0xFFFFFF. + /// public Color? Color => _jsonModel.Color; + /// + /// Text at the bottom of the embed, limited to 2048 characters. + /// public EmbedFooter? Footer { get; } + /// + /// The URL of the image, a large-sized image located below the "Description" element. + /// public EmbedImage? Image { get; } + /// + /// The URL of the thumbnail, a medium-sized image in the top right corner of the embed. + /// public EmbedThumbnail? Thumbnail { get; } + /// + /// The URL of the video to include in the embed. + /// public EmbedVideo? Video { get; } + /// + /// The provider of the embed content (YouTube, Twitter/X, etc). Generally unused in bot embeds. + /// public EmbedProvider? Provider { get; } + /// + /// Adds the author block to the embed, always located at the top of the embed. + /// public EmbedAuthor? Author { get; } + /// + /// Allows you to add multiple subtitles with additional content underneath them below the main "Title" and "Description" blocks, maximum of 25 per embed. + /// public IReadOnlyList Fields { get; } - + /// + /// Creates an embed from its JsonModels equivalent. + /// public Embed(JsonModels.JsonEmbed jsonModel) { _jsonModel = jsonModel; From eb89abde5fce9fc5bbf66ea1280a4576409a1d34 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 21:42:09 +0200 Subject: [PATCH 02/15] Newlines added as requested, and grammatical fix. --- NetCord/Embed.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 8deb2d92c..5a45f34a5 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -1,63 +1,80 @@ namespace NetCord; + /// -/// Displays embedded content such as an image or URL, alongside a title and various other fields. All text in the embed must add up to under 6000 characters, and you can only have up to 10 embed per message. +/// Displays embedded content such as an image or URL, alongside a title and various other fields. All text in the embed must add up to under 6000 characters, and you can only have up to 10 embeds per message. /// public class Embed : IJsonModel { JsonModels.JsonEmbed IJsonModel.JsonModel => _jsonModel; private readonly JsonModels.JsonEmbed _jsonModel; + /// /// The text that is placed above the description, usually highlighted. Also directs to a URL if given, has a 256 character limit. /// + public string? Title => _jsonModel.Title; + /// /// The type of the embed, always set to for webhook embeds. . /// public EmbedType? Type => _jsonModel.Type; + /// /// The part of the embed where most of the text is contained, limited to 4096 characters. /// public string? Description => _jsonModel.Description; + /// /// The link to the address of the webpage. Mostly used with the thumbnail, icon and author elements in order to link to an image. /// public string? Url => _jsonModel.Url; + /// /// Time that the embed was posted. Located next to the footer. /// public DateTimeOffset? Timestamp => _jsonModel.Timestamp; + /// /// Color of your embed’s border, usually in hexadecimal or decimal, specified by an integer between 0x000000 and 0xFFFFFF. /// public Color? Color => _jsonModel.Color; + + /// /// Text at the bottom of the embed, limited to 2048 characters. /// public EmbedFooter? Footer { get; } + /// /// The URL of the image, a large-sized image located below the "Description" element. /// public EmbedImage? Image { get; } + /// /// The URL of the thumbnail, a medium-sized image in the top right corner of the embed. /// public EmbedThumbnail? Thumbnail { get; } + /// /// The URL of the video to include in the embed. /// public EmbedVideo? Video { get; } + /// /// The provider of the embed content (YouTube, Twitter/X, etc). Generally unused in bot embeds. /// public EmbedProvider? Provider { get; } + /// /// Adds the author block to the embed, always located at the top of the embed. /// public EmbedAuthor? Author { get; } + /// /// Allows you to add multiple subtitles with additional content underneath them below the main "Title" and "Description" blocks, maximum of 25 per embed. /// public IReadOnlyList Fields { get; } + /// /// Creates an embed from its JsonModels equivalent. /// From 0a75fe77b7872a2feffe70e1de02edc3357f15db Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:06:50 +0200 Subject: [PATCH 03/15] Removed extra newline Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 5a45f34a5..795d8c06e 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -11,7 +11,6 @@ public class Embed : IJsonModel /// /// The text that is placed above the description, usually highlighted. Also directs to a URL if given, has a 256 character limit. /// - public string? Title => _jsonModel.Title; /// From de2815951e7c0d7c37039d9016b76a834343279e Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:07:29 +0200 Subject: [PATCH 04/15] Removed unnecessary close tag Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 795d8c06e..ce71db719 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -14,7 +14,7 @@ public class Embed : IJsonModel public string? Title => _jsonModel.Title; /// - /// The type of the embed, always set to for webhook embeds. . + /// The type of the embed, always set to for webhook embeds. /// public EmbedType? Type => _jsonModel.Type; From 92e858f235721e67f20a4cfa88aaba574a3e8c3c Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:08:14 +0200 Subject: [PATCH 05/15] Added cref to JsonModels.JsonEmbed Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index ce71db719..af4a78394 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -75,7 +75,7 @@ public class Embed : IJsonModel public IReadOnlyList Fields { get; } /// - /// Creates an embed from its JsonModels equivalent. + /// Creates an embed from its equivalent. /// public Embed(JsonModels.JsonEmbed jsonModel) { From f9d9ab9f10495df0ca1362e2ef5c1dc32445da80 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:08:37 +0200 Subject: [PATCH 06/15] Added cref to Title and Description Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index af4a78394..2cad74605 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -70,7 +70,7 @@ public class Embed : IJsonModel public EmbedAuthor? Author { get; } /// - /// Allows you to add multiple subtitles with additional content underneath them below the main "Title" and "Description" blocks, maximum of 25 per embed. + /// Allows you to add multiple subtitles with additional content underneath them below the main and blocks, maximum of 25 per embed. /// public IReadOnlyList Fields { get; } From bee21481fb5cf99123dfe72dc75e02aa430c8b32 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:17:14 +0200 Subject: [PATCH 07/15] Covered multiple review points --- NetCord/Embed.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 2cad74605..254613288 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -19,26 +19,25 @@ public class Embed : IJsonModel public EmbedType? Type => _jsonModel.Type; /// - /// The part of the embed where most of the text is contained, limited to 4096 characters. + /// The part of the embed where the main text is contained, limited to 4096 characters. /// public string? Description => _jsonModel.Description; /// - /// The link to the address of the webpage. Mostly used with the thumbnail, icon and author elements in order to link to an image. + /// A link to an address of a webpage. When set, the becomes a clickable link, directing to the URL. /// public string? Url => _jsonModel.Url; /// - /// Time that the embed was posted. Located next to the footer. + /// Displays time in a format similar to a message timestamp. Located next to the footer. /// public DateTimeOffset? Timestamp => _jsonModel.Timestamp; /// - /// Color of your embed’s border, usually in hexadecimal or decimal, specified by an integer between 0x000000 and 0xFFFFFF. + /// The color of the embed’s border in an RGB format. /// public Color? Color => _jsonModel.Color; - /// /// Text at the bottom of the embed, limited to 2048 characters. /// From 76e732d2cd1e4ee58ee14e986c59aee5db444bd7 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:50:27 +0200 Subject: [PATCH 08/15] Provider and character limit updated --- NetCord/Embed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 254613288..4d80a407e 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -1,7 +1,7 @@ namespace NetCord; /// -/// Displays embedded content such as an image or URL, alongside a title and various other fields. All text in the embed must add up to under 6000 characters, and you can only have up to 10 embeds per message. +/// Displays embedded content such as an image or URL, alongside a title and various other fields. You can only have up to 10 embeds per message, and the total text of all embeds must be less than 6000 characters. /// public class Embed : IJsonModel { @@ -59,7 +59,7 @@ public class Embed : IJsonModel public EmbedVideo? Video { get; } /// - /// The provider of the embed content (YouTube, Twitter/X, etc). Generally unused in bot embeds. + /// The provider of the embed content (YouTube, Twitter/X, etc), automatically generated from links in content. /// public EmbedProvider? Provider { get; } From 91fd19d742e8a4b0c4125a1d4988745b5d3e008d Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:51:13 +0200 Subject: [PATCH 09/15] Added cref to description Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 4d80a407e..64caff9f7 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -44,7 +44,7 @@ public class Embed : IJsonModel public EmbedFooter? Footer { get; } /// - /// The URL of the image, a large-sized image located below the "Description" element. + /// The URL of the image, a large-sized image located below the element. /// public EmbedImage? Image { get; } From 0d4d3d7fdc543e6537933799b656e41e562a55a8 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:55:18 +0200 Subject: [PATCH 10/15] Updated mentions of URLs to strings containing URLs --- NetCord/Embed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 64caff9f7..2a8958012 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -44,12 +44,12 @@ public class Embed : IJsonModel public EmbedFooter? Footer { get; } /// - /// The URL of the image, a large-sized image located below the element. + /// A string containing the URL of an image, displayed as a large-sized image located below the element. /// public EmbedImage? Image { get; } /// - /// The URL of the thumbnail, a medium-sized image in the top right corner of the embed. + /// A string containing the URL of the thumbnail, displayed as a medium-sized image in the top right corner of the embed. /// public EmbedThumbnail? Thumbnail { get; } From a442b9a71f5927a003621fbfad2a0861fe325ffd Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:52:30 +0200 Subject: [PATCH 11/15] Corrected mislabeled documentation --- NetCord/Embed.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 2a8958012..e48e4e82e 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -44,17 +44,17 @@ public class Embed : IJsonModel public EmbedFooter? Footer { get; } /// - /// A string containing the URL of an image, displayed as a large-sized image located below the element. + /// The image to include in the embed, displayed as a large-sized image located below the element. /// public EmbedImage? Image { get; } /// - /// A string containing the URL of the thumbnail, displayed as a medium-sized image in the top right corner of the embed. + /// The thumbnail of the embed, displayed as a medium-sized image in the top right corner of the embed. /// public EmbedThumbnail? Thumbnail { get; } /// - /// The URL of the video to include in the embed. + /// The video to include and display in the embed. /// public EmbedVideo? Video { get; } From b446691247e3adfda5cf573cef74e9b4744cb657 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:14:39 +0200 Subject: [PATCH 12/15] Clarification on text limits Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Embed.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index e48e4e82e..6051444a9 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -1,7 +1,7 @@ namespace NetCord; /// -/// Displays embedded content such as an image or URL, alongside a title and various other fields. You can only have up to 10 embeds per message, and the total text of all embeds must be less than 6000 characters. +/// Displays embedded content such as an image or URL, alongside a title and various other fields. You can only have up to 10 embeds per message, and the total text of all embeds must be less than or equal 6000 characters. /// public class Embed : IJsonModel { From b03486d85c0332c33284882cd125d7952672f0bd Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:16:45 +0200 Subject: [PATCH 13/15] Changed erroneous type documentation and grammatical fix --- NetCord/Embed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index 6051444a9..a630f40d2 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -1,7 +1,7 @@ namespace NetCord; /// -/// Displays embedded content such as an image or URL, alongside a title and various other fields. You can only have up to 10 embeds per message, and the total text of all embeds must be less than or equal 6000 characters. +/// Displays embedded content such as an image or URL, alongside a title and various other fields. You can only have up to 10 embeds per message, and the total text of all embeds must be less than or equal to 6000 characters. /// public class Embed : IJsonModel { @@ -14,7 +14,7 @@ public class Embed : IJsonModel public string? Title => _jsonModel.Title; /// - /// The type of the embed, always set to for webhook embeds. + /// Information about the type of the embed. /// public EmbedType? Type => _jsonModel.Type; From 31f13be138c5f6c2fd7124ccddfa57787210660a Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:21:07 +0200 Subject: [PATCH 14/15] Rewrite to account for Embed only being a recievable type --- NetCord/Embed.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index a630f40d2..e043031e6 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -9,7 +9,7 @@ public class Embed : IJsonModel private readonly JsonModels.JsonEmbed _jsonModel; /// - /// The text that is placed above the description, usually highlighted. Also directs to a URL if given, has a 256 character limit. + /// The text that is placed above the description, usually highlighted. Also directs to a URL if one is given in , has a 256 character limit. /// public string? Title => _jsonModel.Title; @@ -39,12 +39,12 @@ public class Embed : IJsonModel public Color? Color => _jsonModel.Color; /// - /// Text at the bottom of the embed, limited to 2048 characters. + /// The text at the bottom of the embed, limited to 2048 characters. /// public EmbedFooter? Footer { get; } /// - /// The image to include in the embed, displayed as a large-sized image located below the element. + /// The image included in the embed, displayed as a large-sized image located below the element. /// public EmbedImage? Image { get; } @@ -54,7 +54,7 @@ public class Embed : IJsonModel public EmbedThumbnail? Thumbnail { get; } /// - /// The video to include and display in the embed. + /// The video included and displayed in the embed. /// public EmbedVideo? Video { get; } @@ -64,12 +64,12 @@ public class Embed : IJsonModel public EmbedProvider? Provider { get; } /// - /// Adds the author block to the embed, always located at the top of the embed. + /// Contains the author block of the embed, always located at the top of the embed. /// public EmbedAuthor? Author { get; } /// - /// Allows you to add multiple subtitles with additional content underneath them below the main and blocks, maximum of 25 per embed. + /// Allows the addition of multiple subtitles with additional content underneath them below the main and blocks, maximum of 25 per embed. /// public IReadOnlyList Fields { get; } From e8ffada8f27765cc17c777fcaf028e20bd727dba Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:32:44 +0200 Subject: [PATCH 15/15] Final cleanup --- NetCord/Embed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Embed.cs b/NetCord/Embed.cs index e043031e6..e6d8e562a 100644 --- a/NetCord/Embed.cs +++ b/NetCord/Embed.cs @@ -29,7 +29,7 @@ public class Embed : IJsonModel public string? Url => _jsonModel.Url; /// - /// Displays time in a format similar to a message timestamp. Located next to the footer. + /// Displays time in a format similar to a message timestamp. Located next to the . /// public DateTimeOffset? Timestamp => _jsonModel.Timestamp; @@ -64,7 +64,7 @@ public class Embed : IJsonModel public EmbedProvider? Provider { get; } /// - /// Contains the author block of the embed, always located at the top of the embed. + /// Contains the author block, always located at the top of the embed. /// public EmbedAuthor? Author { get; }