-
-
Notifications
You must be signed in to change notification settings - Fork 40
Merge extended XML documentation. #389
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -45,42 +45,42 @@ public Application(JsonModels.JsonApplication jsonModel, RestClient client) : ba | |||||
| } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The ID of the application. | ||||||
| /// The application's ID.. | ||||||
| /// </summary> | ||||||
| public override ulong Id => _jsonModel.Id; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The name of the application. | ||||||
| /// The application's name. | ||||||
| /// </summary> | ||||||
| public string Name => _jsonModel.Name; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The icon hash of the application. | ||||||
| /// The application's icon hash. | ||||||
| /// </summary> | ||||||
| public string? IconHash => _jsonModel.IconHash; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The description of the application. | ||||||
| /// The application's description. | ||||||
| /// </summary> | ||||||
| public string Description => _jsonModel.Description; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// A list of the application's RPC origin URLs. <see langword="null"/> if RPC is disabled. | ||||||
| /// A list of the application's RPC origin URLs if enabled, otherwise <see langword="null"/>. | ||||||
| /// </summary> | ||||||
| public IReadOnlyList<string> RpcOrigins => _jsonModel.RpcOrigins; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// When <see langword="false"/>, only the application owner can add the application to guilds. | ||||||
| /// Whether users other than the owner can add the application to guilds. | ||||||
| /// </summary> | ||||||
| public bool? BotPublic => _jsonModel.BotPublic; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// When <see langword="true"/>, the application's bot will only join upon completion of the full OAuth2 code grant flow. | ||||||
| /// Whether the application's bot will only join upon completion of the full OAuth2 code grant flow. | ||||||
| /// </summary> | ||||||
| public bool? BotRequireCodeGrant => _jsonModel.BotRequireCodeGrant; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The partial <see cref="User"/> object of the application's bot. | ||||||
| /// The application's user object, representing its bot. | ||||||
| /// </summary> | ||||||
| public User? Bot { get; } | ||||||
|
|
||||||
|
|
@@ -95,42 +95,42 @@ public Application(JsonModels.JsonApplication jsonModel, RestClient client) : ba | |||||
| public string? PrivacyPolicyUrl => _jsonModel.PrivacyPolicyUrl; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The partial <see cref="User"/> object of the application's owner. | ||||||
| /// The application owner's user object. | ||||||
| /// </summary> | ||||||
| public User? Owner { get; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The hex-encoded verification key used for HTTP interactions and the GameSDK's GetTicket. | ||||||
| /// A hex-encoded verification key, used for HTTP interactions and the GameSDK's GetTicket endpoint. | ||||||
| /// </summary> | ||||||
| public string VerifyKey => _jsonModel.VerifyKey; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The team the application belongs to. Is <see langword="null"/> if the application does not belong to a team. | ||||||
| /// The team the application belongs to, if any. | ||||||
| /// </summary> | ||||||
| public Team? Team { get; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The ID of the guild associated with the application. For example, a developer support server. | ||||||
| /// The ID corresponding to the application's guild. | ||||||
| /// </summary> | ||||||
| public ulong? GuildId => _jsonModel.GuildId; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The partial <see cref="RestGuild"/> object of the application's associated guild. | ||||||
| /// The application guild's object. | ||||||
| /// </summary> | ||||||
| public RestGuild? Guild { get; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The ID of the Game SKU created, if one exists. Is <see langword="null"/> if the application is not a game sold on Discord. | ||||||
| /// The ID of the appliication's Game SKU if it exists, otherwise <see langword="null"/>. | ||||||
| /// </summary> | ||||||
| public ulong? PrimarySkuId => _jsonModel.PrimarySkuId; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The URL slug that links to an application's store page. Is <see langword="null"/> if the application is not a game sold on Discord. | ||||||
| /// The URL slug that links to an application's store pageif it exists, otherwise <see langword="null"/>. | ||||||
|
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.
Suggested change
|
||||||
| /// </summary> | ||||||
| public string? Slug => _jsonModel.Slug; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The cover image hash of the application's default rich presence invite. | ||||||
| /// The cover image hash for the application's default rich presence invite. | ||||||
| /// </summary> | ||||||
| public string? CoverImageHash => _jsonModel.CoverImageHash; | ||||||
|
|
||||||
|
|
@@ -150,7 +150,7 @@ public Application(JsonModels.JsonApplication jsonModel, RestClient client) : ba | |||||
| public int? ApproximateUserInstallCount => _jsonModel.ApproximateUserInstallCount; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The application's redirect URI list. | ||||||
| /// A list of the application's redirect URIs. | ||||||
| /// </summary> | ||||||
| public IReadOnlyList<string>? RedirectUris => _jsonModel.RedirectUris; | ||||||
|
|
||||||
|
|
@@ -170,32 +170,35 @@ public Application(JsonModels.JsonApplication jsonModel, RestClient client) : ba | |||||
| public string? EventWebhooksUrl => _jsonModel.EventWebhooksUrl; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The application's event webhooks status. | ||||||
| /// The application's configuration for webhook events. | ||||||
| /// </summary> | ||||||
| public ApplicationEventWebhooksStatus EventWebhooksStatus => _jsonModel.EventWebhooksStatus; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The list of event webhook types that the application supports. | ||||||
| /// A list of event webhook types that the application supports. | ||||||
| /// </summary> | ||||||
| public IReadOnlyList<string>? EventWebhooksTypes => _jsonModel.EventWebhooksTypes; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The application's tag list, describing its content and functionality. Max of 5 tags. | ||||||
| /// A list of the application's tags, describing its content and functionality. | ||||||
| /// </summary> | ||||||
| /// <remarks> | ||||||
| /// A maximum of 5 tags is supported. | ||||||
| /// </remarks> | ||||||
| public IReadOnlyList<string>? Tags => _jsonModel.Tags; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The application's default in-app authorization URL. Is <see langword="null"/> if disabled. | ||||||
| /// The application's default in-app authorization URL if enabled, otherwise <see langword="null"/>. | ||||||
| /// </summary> | ||||||
| public ApplicationInstallParams? InstallParams { get; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The default scopes and permissions for each supported installation context. | ||||||
| /// A list of the app's default scopes and permissions, for each supported installation context. | ||||||
|
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.
Suggested change
|
||||||
| /// </summary> | ||||||
| public IReadOnlyDictionary<ApplicationIntegrationType, ApplicationIntegrationTypeConfiguration>? IntegrationTypesConfiguration { get; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// The application's default custom install URL. Is <see langword="null"/> if disabled. | ||||||
| /// The application's default custom install URL if enabled, otherwise <see langword="null"/>. | ||||||
| /// </summary> | ||||||
| public string? CustomInstallUrl => _jsonModel.CustomInstallUrl; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,36 +2,59 @@ | |||||
|
|
||||||
| namespace NetCord; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Specifies the capabilities and status of an app. | ||||||
| /// </summary> | ||||||
| [Flags] | ||||||
| public enum ApplicationFlags : uint | ||||||
| { | ||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates if an embedded app is available to play. | ||||||
| /// </summary> | ||||||
| EmbeddedReleased = 1 << 1, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates if an app has the ability to create twitch-style emoji. | ||||||
| /// </summary> | ||||||
| ManagedEmoji = 1 << 2, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates that an embedded app has the ability to create in-app purchases. | ||||||
| /// </summary> | ||||||
| EmbeddedIAP = 1 << 3, | ||||||
| EmbeddedInAppPurchases = 1 << 3, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates if an app has permission to create group DMs. | ||||||
| /// </summary> | ||||||
| GroupDMCreate = 1 << 4, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Allows the application access the local RPC server. | ||||||
|
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.
Suggested change
|
||||||
| /// </summary> | ||||||
| RpcPrivateBeta = 1 << 5, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indicates if an app uses the Auto Moderation API. | ||||||
| /// </summary> | ||||||
| ApplicationAutoModerationRuleCreateBadge = 1 << 6, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates if an app is allowed to create activity assets. | ||||||
| /// </summary> | ||||||
| AllowAssets = 1 << 8, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indicates if an app is allowed to enable activity spectating. | ||||||
| /// </summary> | ||||||
| AllowActivityActionSpectate = 1 << 9, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indicates if an app is allowed to enable join requests for activities. | ||||||
| /// </summary> | ||||||
| AllowActivityActionJoinRequest = 1 << 10, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indiicates whether an app has ever accessed the local RPC server. | ||||||
| /// </summary> | ||||||
| RPCHasConnected = 1 << 11, | ||||||
|
Comment on lines
+34
to
59
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. RPC inconsistency. Rpc vs RPC in RpcPrivateBeta and RPCHasConnected. |
||||||
|
|
||||||
|
|
@@ -76,12 +99,22 @@ public enum ApplicationFlags : uint | |||||
| GatewayMessageContentLimited = 1 << 19, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Undocumented. | ||||||
| /// Indicates a first-party embedded app. | ||||||
| /// </summary> | ||||||
| EmbeddedFirstParty = 1 << 20, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indicates if an app has registered global application commands. | ||||||
| /// </summary> | ||||||
| ApplicationCommandBadge = 1 << 23, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indicates if an app is considered active. | ||||||
| /// </summary> | ||||||
| Active = 1 << 24, | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Indiciates if an app is allowed to use IFrame modals. | ||||||
| /// </summary> | ||||||
| IFrameModal = 1 << 26, | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| namespace NetCord; | ||
|
|
||
| /// <summary> | ||
| /// Represents an app integration's install type. | ||
| /// </summary> | ||
| public enum ApplicationIntegrationType | ||
| { | ||
| /// <summary> | ||
| /// App is installable to servers. | ||
| /// App is available for guild installs. | ||
| /// </summary> | ||
| GuildInstall = 0, | ||
|
|
||
| /// <summary> | ||
| /// App is installable to users. | ||
| /// App is available for user installs. | ||
| /// </summary> | ||
| UserInstall = 1, | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| using NetCord.Rest; | ||
|
|
||
| namespace NetCord; | ||
|
|
||
| /// <summary> | ||
| /// Represents a message attachment, and its contained data. | ||
| /// </summary> | ||
| public class Attachment(JsonModels.JsonAttachment jsonModel) : Entity, IJsonModel<JsonModels.JsonAttachment> | ||
| { | ||
| JsonModels.JsonAttachment IJsonModel<JsonModels.JsonAttachment>.JsonModel => _jsonModel; | ||
|
|
@@ -8,37 +13,37 @@ public class Attachment(JsonModels.JsonAttachment jsonModel) : Entity, IJsonMode | |
| public override ulong Id => _jsonModel.Id; | ||
|
|
||
| /// <summary> | ||
| /// Name of the attachment. | ||
| /// Name of the attachment (max 1024 characters for attachments sent by message, 2-30 characters for attachments used for sticker creation). | ||
| /// </summary> | ||
| public string FileName => _jsonModel.FileName; | ||
|
|
||
| /// <summary> | ||
| /// Title of the attachment. | ||
| /// The title of the attachment. | ||
| /// </summary> | ||
| public string? Title => _jsonModel.Title; | ||
|
|
||
| /// <summary> | ||
| /// Description for the attachment (max 1024 characters). | ||
| /// Description for the attachment (max 1024 characters for attachments sent by message, max 200 characters for attachments used for sticker creation). | ||
| /// </summary> | ||
| public string? Description => _jsonModel.Description; | ||
|
|
||
| /// <summary> | ||
| /// The attachment's media type. | ||
| /// The attachment's media (MIME) type. | ||
| /// </summary> | ||
| public string? ContentType => _jsonModel.ContentType; | ||
|
|
||
| /// <summary> | ||
| /// Size of file in bytes. | ||
| /// The attachment's size in bytes. | ||
| /// </summary> | ||
| public long Size => _jsonModel.Size; | ||
|
|
||
| /// <summary> | ||
| /// Source url of file. | ||
| /// The attachment's source URL. | ||
| /// </summary> | ||
| public string Url => _jsonModel.Url; | ||
|
|
||
| /// <summary> | ||
| /// A proxied url of file. | ||
| /// The attachment's source URL, proxied through Discord's CDN. | ||
| /// </summary> | ||
| public string ProxyUrl => _jsonModel.ProxyUrl; | ||
|
|
||
|
|
@@ -47,16 +52,24 @@ public class Attachment(JsonModels.JsonAttachment jsonModel) : Entity, IJsonMode | |
| /// </summary> | ||
| public bool Ephemeral => _jsonModel.Ephemeral; | ||
|
|
||
| /// <summary> | ||
| /// Additional information about the attachment's type. | ||
| /// </summary> | ||
| public AttachmentFlags Flags => _jsonModel.Flags; | ||
|
|
||
| /// <summary> | ||
| /// Returns expiration and issue info for the attachment's source URL. | ||
| /// </summary> | ||
| public AttachmentExpirationInfo GetExpirationInfo() => new(Url); | ||
|
|
||
| public static Attachment CreateFromJson(JsonModels.JsonAttachment jsonModel) | ||
| public static Attachment CreateFromJson(JsonModels.JsonAttachment jsonModel, RestClient client) | ||
| { | ||
| if (jsonModel.Width.HasValue) | ||
| return new ImageAttachment(jsonModel); | ||
| else if (jsonModel.DurationSeconds.HasValue) | ||
| return new VoiceAttachment(jsonModel); | ||
| else if (jsonModel.ClipCreatedAt.HasValue) | ||
| return new ClipAttachment(jsonModel, client); | ||
|
Comment on lines
+71
to
+72
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. It may be a better idea to check flags instead of relying on created at |
||
| else | ||
| return new Attachment(jsonModel); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.