From cdda5bc2243dd52e48957b58e4f59b86ea784ac3 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Tue, 17 Dec 2024 08:14:36 +0100 Subject: [PATCH] hide callback hints, not released sadly --- .../Interaction/DiscordCallbackHintBuilder.cs | 12 ++++++------ .../Interaction/DiscordInteractionModalBuilder.cs | 2 +- .../DiscordInteractionResponseBuilder.cs | 14 +++++++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/DisCatSharp/Entities/Interaction/DiscordCallbackHintBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordCallbackHintBuilder.cs index 462ff8a43e..c299bdb7c1 100644 --- a/DisCatSharp/Entities/Interaction/DiscordCallbackHintBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordCallbackHintBuilder.cs @@ -7,12 +7,12 @@ namespace DisCatSharp.Entities; /// /// Represents a callback hint builder for an interaction. /// -public sealed class DiscordCallbackHintBuilder +internal sealed class DiscordCallbackHintBuilder { /// /// Constructs a new . /// - public DiscordCallbackHintBuilder() + internal DiscordCallbackHintBuilder() { this.Clear(); } @@ -21,7 +21,7 @@ public DiscordCallbackHintBuilder() /// Constructs a new from an existing one. /// /// The existing . - public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other) + internal DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other) { this.Clear(); this.CallbackHints.AddRange(other.CallbackHints); @@ -30,7 +30,7 @@ public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other) /// /// Gets the callback hints. /// - public List CallbackHints { get; internal set; } = []; + internal List CallbackHints { get; set; } = []; /// /// Adds a callback hint to the builder. @@ -39,7 +39,7 @@ public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other) /// The intended use of ephemeral. Required if it's only ephemeral. /// The intended required permissions. /// The updated . - public DiscordCallbackHintBuilder AddCallbackHint(InteractionResponseType intendedCallbackType, InteractionCallbackEphemerality intendedCallbackEphemerality = InteractionCallbackEphemerality.Optional, Permissions? intendedRequiredPermissions = null) + internal DiscordCallbackHintBuilder AddCallbackHint(InteractionResponseType intendedCallbackType, InteractionCallbackEphemerality intendedCallbackEphemerality = InteractionCallbackEphemerality.Optional, Permissions? intendedRequiredPermissions = null) { this.CallbackHints.Add(new() { @@ -53,6 +53,6 @@ public DiscordCallbackHintBuilder AddCallbackHint(InteractionResponseType intend /// /// Clears the callback hints. /// - public void Clear() + internal void Clear() => this.CallbackHints.Clear(); } diff --git a/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs index 42ddc26e4d..89d0c832d5 100644 --- a/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs @@ -92,7 +92,7 @@ public DiscordInteractionModalBuilder WithCustomId(string customId) /// The hint builder. /// The current builder to chain calls with. /// Thrown when the is . - public DiscordInteractionModalBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder) + internal DiscordInteractionModalBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder) { if (hintBuilder == null) throw new ArgumentNullException(nameof(hintBuilder), "Callback hint builder cannot be null."); diff --git a/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs index 6f0c544cfe..4a2772c00e 100644 --- a/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs @@ -12,6 +12,9 @@ namespace DisCatSharp.Entities; /// public sealed class DiscordInteractionResponseBuilder : DisCatSharpBuilder { + /// + /// Gets the callback hints. + /// private readonly List _callbackHints = []; /// @@ -37,6 +40,9 @@ public DiscordInteractionResponseBuilder(DisCatSharpBuilder builder) this.AttachmentsInternal.AddRange(builder.Attachments); } + /// + /// Gets the choices. + /// internal List ChoicesInternal { get; } = []; /// @@ -63,12 +69,14 @@ public bool IsEphemeral /// The choices to send on this interaction response. /// Mutually exclusive with content, embed, and components. /// - public IReadOnlyList Choices => this.ChoicesInternal; + public IReadOnlyList Choices + => this.ChoicesInternal; /// /// The hints to send on this interaction response. /// - public IReadOnlyList CallbackHints => this._callbackHints; + internal IReadOnlyList CallbackHints + => this._callbackHints; /// /// Gets the poll for this message. @@ -81,7 +89,7 @@ public bool IsEphemeral /// The hint builder. /// The current builder to chain calls with. /// Thrown when the is . - public DiscordInteractionResponseBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder) + internal DiscordInteractionResponseBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder) { if (hintBuilder == null) throw new ArgumentNullException(nameof(hintBuilder), "Callback hint builder cannot be null.");