Skip to content

Commit

Permalink
An AddSlashCommand overload should be AddAutocompleteCommand in Modul…
Browse files Browse the repository at this point in the history
…eBuilder (#3014)
  • Loading branch information
gehongyan authored Jan 7, 2025
1 parent 2759dba commit 35e8122
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Discord.Net.Interactions/Builders/ModuleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ public ModuleBuilder AddAutocompleteCommand(Action<AutocompleteCommandBuilder> c
return this;
}

/// <inheritdoc cref="Discord.Interactions.Builders.ModuleBuilder.AddAutocompleteCommand(System.String,Discord.Interactions.ExecuteCallback,System.Action{Discord.Interactions.Builders.AutocompleteCommandBuilder})" />
[Obsolete("This method will be deprecated soon. Use AddAutocompleteCommand instead.")]
public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action<AutocompleteCommandBuilder> configure)
=> AddAutocompleteCommand(name, callback, configure);

/// <summary>
/// Adds autocomplete command builder to <see cref="AutocompleteCommands"/>.
/// </summary>
Expand All @@ -380,7 +385,7 @@ public ModuleBuilder AddAutocompleteCommand(Action<AutocompleteCommandBuilder> c
/// <returns>
/// The builder instance.
/// </returns>
public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action<AutocompleteCommandBuilder> configure)
public ModuleBuilder AddAutocompleteCommand(string name, ExecuteCallback callback, Action<AutocompleteCommandBuilder> configure)
{
var command = new AutocompleteCommandBuilder(this, name, callback);
configure(command);
Expand All @@ -403,7 +408,7 @@ public ModuleBuilder AddModalCommand(Action<ModalCommandBuilder> configure)
_modalCommands.Add(command);
return this;
}

/// <summary>
/// Adds a modal command builder to <see cref="ModalCommands"/>.
/// </summary>
Expand Down

0 comments on commit 35e8122

Please sign in to comment.