Skip to content

Commit

Permalink
docs: mark features as experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Nov 9, 2023
1 parent 80b3263 commit f65c572
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion DisCatSharp.Attributes/Features.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public enum Features : long
ServerSubscription = 1<<6,

[FeatureDescription("Requires that the application has monetization enabled.")]
MonetizedApplication = 1<<7
MonetizedApplication = 1<<7,

[FeatureDescription("Requires that the user and/or guild has a specific experiment and/or treatment.")]
Experiment = 1<<8,
}


Expand Down
16 changes: 14 additions & 2 deletions DisCatSharp.Experimental/DisCatSharpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static async Task<string> GetUsernameAsync(this DiscordClient client, ulo
/// </summary>
/// <param name="client">The discord client.</param>
/// <param name="profileId">The profile id to get.</param>
/// <returns></returns>
[RequiresFeature(Features.Override, "This method requires the guild and/or user to have access to clyde with treatment 5.")] // TODO: Change to Features.Experiment
public static async Task<ClydeProfile> GetClydeProfileAsync(this DiscordClient client, ulong profileId)
{
DiscordApiClientHook hook = new(client.ApiClient);
Expand All @@ -37,6 +37,7 @@ public static async Task<ClydeProfile> GetClydeProfileAsync(this DiscordClient c
/// Gets the clyde settings for the given <paramref name="guild"/>.
/// </summary>
/// <param name="guild">The guild to get clyde's settings for.</param>
[RequiresFeature(Features.Override, "This method requires the guild and/or user to have access to clyde with treatment 5.")] // TODO: Change to Features.Experiment
public static async Task<ClydeSettings> GetClydeSettingsAsync(this DiscordGuild guild)
{
DiscordApiClientHook hook = new(guild.Discord.ApiClient);
Expand All @@ -48,13 +49,23 @@ public static async Task<ClydeSettings> GetClydeSettingsAsync(this DiscordGuild
/// </summary>
/// <param name="guild">The guild to modify clyde's settings for.</param>
/// <param name="profileId">The profile id to apply.</param>
/// <returns></returns>
[RequiresFeature(Features.Override, "This method requires the guild and/or user to have access to clyde with treatment 5.")] // TODO: Change to Features.Experiment
public static async Task<ClydeSettings> ModifyClydeSettingsAsync(this DiscordGuild guild, ulong profileId)
{
DiscordApiClientHook hook = new(guild.Discord.ApiClient);
return await hook.ModifyClydeSettingsAsync(guild.Id, profileId);
}

/// <summary>
/// Modifies the clyde settings for the given <paramref name="guild"/>.
/// </summary>
/// <param name="guild">The guild to modify clyde's settings for.</param>
/// <param name="name">The new name.</param>
/// <param name="personality">The new basePersonality.</param>
/// <param name="avatar">The new avatar.</param>
/// <param name="banner">The new banner.</param>
/// <param name="themeColors">The new theme colors.</param>
[RequiresFeature(Features.Override, "This method requires the guild and/or user to have access to clyde with treatment 5.")] // TODO: Change to Features.Experiment
public static async Task<ClydeSettings> ModifyClydeSettingsAsync(
this DiscordGuild guild,
Optional<string?> name,
Expand All @@ -78,6 +89,7 @@ public static async Task<ClydeSettings> ModifyClydeSettingsAsync(
/// </summary>
/// <param name="client">The discord client.</param>
/// <param name="basePersonality">The base base personality to generate a new one from.</param>
[RequiresFeature(Features.Override, "This method requires the guild and/or user to have access to clyde with treatment 5.")] // TODO: Change to Features.Experiment
public static async Task<string> GenerateClydePersonalityAsync(this DiscordClient client, string? basePersonality = null)
{
DiscordApiClientHook hook = new(client.ApiClient);
Expand Down

0 comments on commit f65c572

Please sign in to comment.