Skip to content

Commit

Permalink
hide callback hints, not released sadly
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Dec 17, 2024
1 parent 549c5b0 commit cdfbc84
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
12 changes: 6 additions & 6 deletions DisCatSharp/Entities/Interaction/DiscordCallbackHintBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a callback hint builder for an interaction.
/// </summary>
public sealed class DiscordCallbackHintBuilder
internal sealed class DiscordCallbackHintBuilder
{
/// <summary>
/// Constructs a new <see cref="DiscordCallbackHintBuilder" />.
/// </summary>
public DiscordCallbackHintBuilder()
internal DiscordCallbackHintBuilder()
{
this.Clear();
}
Expand All @@ -21,7 +21,7 @@ public DiscordCallbackHintBuilder()
/// Constructs a new <see cref="DiscordCallbackHintBuilder" /> from an existing one.
/// </summary>
/// <param name="other">The existing <see cref="DiscordCallbackHintBuilder" />.</param>
public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other)
internal DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other)
{
this.Clear();
this.CallbackHints.AddRange(other.CallbackHints);
Expand All @@ -30,7 +30,7 @@ public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other)
/// <summary>
/// Gets the callback hints.
/// </summary>
public List<DiscordInteractionCallbackHint> CallbackHints { get; internal set; } = [];
internal List<DiscordInteractionCallbackHint> CallbackHints { get; set; } = [];

/// <summary>
/// Adds a callback hint to the builder.
Expand All @@ -39,7 +39,7 @@ public DiscordCallbackHintBuilder(DiscordCallbackHintBuilder other)
/// <param name="intendedCallbackEphemerality">The intended use of ephemeral. Required if it's only ephemeral.</param>
/// <param name="intendedRequiredPermissions">The intended required permissions.</param>
/// <returns>The updated <see cref="DiscordCallbackHintBuilder" />.</returns>
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()
{
Expand All @@ -53,6 +53,6 @@ public DiscordCallbackHintBuilder AddCallbackHint(InteractionResponseType intend
/// <summary>
/// Clears the callback hints.
/// </summary>
public void Clear()
internal void Clear()
=> this.CallbackHints.Clear();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ namespace DisCatSharp.Entities;
/// </summary>
public sealed class DiscordInteractionResponseBuilder : DisCatSharpBuilder
{
/// <summary>
/// Gets the callback hints.
/// </summary>
private readonly List<DiscordInteractionCallbackHint> _callbackHints = [];

/// <summary>
Expand All @@ -37,6 +40,9 @@ public DiscordInteractionResponseBuilder(DisCatSharpBuilder builder)
this.AttachmentsInternal.AddRange(builder.Attachments);
}

/// <summary>
/// Gets the choices.
/// </summary>
internal List<DiscordApplicationCommandAutocompleteChoice> ChoicesInternal { get; } = [];

/// <summary>
Expand All @@ -63,12 +69,14 @@ public bool IsEphemeral
/// The choices to send on this interaction response.
/// Mutually exclusive with content, embed, and components.
/// </summary>
public IReadOnlyList<DiscordApplicationCommandAutocompleteChoice> Choices => this.ChoicesInternal;
public IReadOnlyList<DiscordApplicationCommandAutocompleteChoice> Choices
=> this.ChoicesInternal;

/// <summary>
/// The hints to send on this interaction response.
/// </summary>
public IReadOnlyList<DiscordInteractionCallbackHint> CallbackHints => this._callbackHints;
internal IReadOnlyList<DiscordInteractionCallbackHint> CallbackHints
=> this._callbackHints;

/// <summary>
/// Gets the poll for this message.
Expand All @@ -81,7 +89,7 @@ public bool IsEphemeral
/// <param name="hintBuilder">The hint builder.</param>
/// <returns>The current builder to chain calls with.</returns>
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="hintBuilder" /> is <see langword="null" />.</exception>
public DiscordInteractionResponseBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder)
internal DiscordInteractionResponseBuilder WithCallbackHints(DiscordCallbackHintBuilder hintBuilder)
{
if (hintBuilder == null)
throw new ArgumentNullException(nameof(hintBuilder), "Callback hint builder cannot be null.");
Expand Down

0 comments on commit cdfbc84

Please sign in to comment.