An AddSlashCommand overload should be AddAutocompleteCommand in ModuleBuilder (#3014)

This commit is contained in:
Ge
2025-01-08 06:14:09 +08:00
committed by GitHub
parent 2759dbacdb
commit 35e812253a

View File

@@ -371,6 +371,11 @@ namespace Discord.Interactions.Builders
return this; 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> /// <summary>
/// Adds autocomplete command builder to <see cref="AutocompleteCommands"/>. /// Adds autocomplete command builder to <see cref="AutocompleteCommands"/>.
/// </summary> /// </summary>
@@ -380,7 +385,7 @@ namespace Discord.Interactions.Builders
/// <returns> /// <returns>
/// The builder instance. /// The builder instance.
/// </returns> /// </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); var command = new AutocompleteCommandBuilder(this, name, callback);
configure(command); configure(command);
@@ -403,7 +408,7 @@ namespace Discord.Interactions.Builders
_modalCommands.Add(command); _modalCommands.Add(command);
return this; return this;
} }
/// <summary> /// <summary>
/// Adds a modal command builder to <see cref="ModalCommands"/>. /// Adds a modal command builder to <see cref="ModalCommands"/>.
/// </summary> /// </summary>