-
-
Notifications
You must be signed in to change notification settings - Fork 40
Added documentation to embed component files. #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c05a2b2
Added documentation to embed component files.
Red-K0 105ee5e
Extra tag removed
Red-K0 89bfcec
Extra newline removed
Red-K0 e6a45b3
Grammar fix
Red-K0 050b970
Grammatical fix
Red-K0 05b33e8
Grammar fix
Red-K0 762d7c3
Gr
Red-K0 9190530
Grammar fix
Red-K0 63ec0f4
Clarification on URL wording
Red-K0 2df7259
Clarification of URL wording
Red-K0 26a4e12
Reverted documentation
Red-K0 deadab5
Reverted reverted documentation
Red-K0 6445ddc
Properly reverted documentation
Red-K0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
|
|
||
| public string Value => _jsonModel.Value; | ||
| /// <summary> | ||
|
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; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
Red-K0 marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have reverted a wrong line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.