Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions NetCord/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -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 application'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 page if it exists, otherwise <see langword="null"/>.
/// </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;

Expand All @@ -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;

Expand All @@ -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-application 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 application's default scopes and permissions, for each supported installation context.
/// </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;

Expand Down
2 changes: 1 addition & 1 deletion NetCord/ApplicationCommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum ApplicationCommandType
Message = 3,

/// <summary>
/// UI-based. Represents the primary way to invoke an app's Activity.
/// UI-based. Represents the primary way to invoke an application's Activity.
/// </summary>
EntryPoint = 4,
}
3 changes: 3 additions & 0 deletions NetCord/ApplicationEventWebhooksStatus.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace NetCord;

/// <summary>
/// Specifies an application's configuration for webhook events.
/// </summary>
public enum ApplicationEventWebhooksStatus
{
/// <summary>
Expand Down
63 changes: 48 additions & 15 deletions NetCord/ApplicationFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,69 @@

namespace NetCord;

/// <summary>
/// Specifies the capabilities and status of an application.
/// </summary>
[Flags]
public enum ApplicationFlags : uint
{
/// <summary>
/// Undocumented.
/// Indicates if an embedded application is available to play.
/// </summary>
EmbeddedReleased = 1 << 1,

/// <summary>
/// Undocumented.
/// Indicates if an application has the ability to create twitch-style emoji.
/// </summary>
ManagedEmoji = 1 << 2,

/// <summary>
/// Undocumented.
/// Indicates that an embedded application has the ability to create in-application purchases.
/// </summary>
EmbeddedIAP = 1 << 3,
EmbeddedInAppPurchases = 1 << 3,

/// <summary>
/// Undocumented.
/// Indicates if an application has permission to create group DMs.
/// </summary>
GroupDMCreate = 1 << 4,

/// <summary>
/// Indicates if an app uses the Auto Moderation API.
/// Indicates if an application has access to the local RPC server.
/// </summary>
RpcPrivateBeta = 1 << 5,

/// <summary>
/// Indicates if an application uses the Auto Moderation API.
/// </summary>
ApplicationAutoModerationRuleCreateBadge = 1 << 6,

/// <summary>
/// Undocumented.
/// Indicates if an application is allowed to create activity assets.
/// </summary>
AllowAssets = 1 << 8,

/// <summary>
/// Indicates if an application is allowed to enable activity spectating.
/// </summary>
AllowActivityActionSpectate = 1 << 9,

/// <summary>
/// Indicates if an application is allowed to enable join requests for activities.
/// </summary>
RPCHasConnected = 1 << 11,
AllowActivityActionJoinRequest = 1 << 10,

/// <summary>
/// Indiicates whether an application has ever accessed the local RPC server.
/// </summary>
RpcHasConnected = 1 << 11,

/// <summary>
/// Intent required for bots in 100 or more servers to receive <see cref="GatewayClient.PresenceUpdate"/> events.
/// </summary>
GatewayPresence = 1 << 12,

/// <summary>
/// Intent required for bots in under 100 servers to receive <see cref="GatewayClient.PresenceUpdate"/> events, found on the Bot page in your app's settings.
/// Intent required for bots in under 100 servers to receive <see cref="GatewayClient.PresenceUpdate"/> events, found on the Bot page in your application's settings.
/// </summary>
GatewayPresenceLimited = 1 << 13,

Expand All @@ -51,17 +74,17 @@ public enum ApplicationFlags : uint
GatewayGuildUsers = 1 << 14,

/// <summary>
/// Intent required for bots in under 100 servers to receive guild user-related events like <see cref="GatewayClient.GuildUserAdd"/>, on the Bot page in your app's settings.
/// Intent required for bots in under 100 servers to receive guild user-related events like <see cref="GatewayClient.GuildUserAdd"/>, on the Bot page in your application's settings.
/// </summary>
GatewayGuildUsersLimited = 1 << 15,

/// <summary>
/// Indicates unusual growth of an app that prevents verification.
/// Indicates unusual growth of an application that prevents verification.
/// </summary>
VerificationPendingGuildLimit = 1 << 16,

/// <summary>
/// Indicates if an app is embedded within the Discord client.
/// Indicates if an application is embedded within the Discord client.
/// </summary>
Embedded = 1 << 17,

Expand All @@ -71,17 +94,27 @@ public enum ApplicationFlags : uint
GatewayMessageContent = 1 << 18,

/// <summary>
/// Intent required for bots in under 100 servers to receive message content, found on the Bot page in your app's settings.
/// Intent required for bots in under 100 servers to receive message content, found on the Bot page in your application's settings.
/// </summary>
GatewayMessageContentLimited = 1 << 19,

/// <summary>
/// Undocumented.
/// Indicates a first-party embedded application.
/// </summary>
EmbeddedFirstParty = 1 << 20,

/// <summary>
/// Indicates if an app has registered global application commands.
/// Indicates if an application has registered global application commands.
/// </summary>
ApplicationCommandBadge = 1 << 23,

/// <summary>
/// Indicates if an application is considered active.
/// </summary>
Active = 1 << 24,

/// <summary>
/// Indiciates if an application is allowed to use IFrame modals.
/// </summary>
IFrameModal = 1 << 26,
}
7 changes: 5 additions & 2 deletions NetCord/ApplicationInstallParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

namespace NetCord;

/// <summary>
/// Represents the configuration state for an application install.
/// </summary>
public class ApplicationInstallParams(JsonApplicationInstallParams jsonModel) : IJsonModel<JsonApplicationInstallParams>
{
JsonApplicationInstallParams IJsonModel<JsonApplicationInstallParams>.JsonModel => jsonModel;

/// <summary>
/// Scopes to add the application to the server with.
/// The scopes to use when installing the application to the guild.
/// </summary>
public IReadOnlyList<string> Scopes => jsonModel.Scopes;

/// <summary>
/// Permissions to request for the bot role.
/// The permissions to request for the application's bot role.
/// </summary>
public Permissions Permissions => jsonModel.Permissions;
}
7 changes: 5 additions & 2 deletions NetCord/ApplicationIntegrationType.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
namespace NetCord;

/// <summary>
/// Represents an application 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,
}
5 changes: 4 additions & 1 deletion NetCord/ApplicationIntegrationTypeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace NetCord;

/// <summary>
/// Represents additional configuration for a specific application installation context.
/// </summary>
public class ApplicationIntegrationTypeConfiguration : IJsonModel<JsonApplicationIntegrationTypeConfiguration>
{
private readonly JsonApplicationIntegrationTypeConfiguration _jsonModel;
Expand All @@ -17,7 +20,7 @@ public ApplicationIntegrationTypeConfiguration(JsonApplicationIntegrationTypeCon
}

/// <summary>
/// Install params for each installation context's default in-app authorization link.
/// Additional installation params to apply to the specific install context.
/// </summary>
public ApplicationInstallParams? OAuth2InstallParams { get; }
}
Loading