From 35e812253a8c94cf7a81e0fdfda7da94762b5c29 Mon Sep 17 00:00:00 2001 From: Ge Date: Wed, 8 Jan 2025 06:14:09 +0800 Subject: [PATCH] An AddSlashCommand overload should be AddAutocompleteCommand in ModuleBuilder (#3014) --- src/Discord.Net.Interactions/Builders/ModuleBuilder.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs b/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs index c33ffbc4..701da645 100644 --- a/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs +++ b/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs @@ -371,6 +371,11 @@ namespace Discord.Interactions.Builders return this; } + /// + [Obsolete("This method will be deprecated soon. Use AddAutocompleteCommand instead.")] + public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action configure) + => AddAutocompleteCommand(name, callback, configure); + /// /// Adds autocomplete command builder to . /// @@ -380,7 +385,7 @@ namespace Discord.Interactions.Builders /// /// The builder instance. /// - public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action configure) + public ModuleBuilder AddAutocompleteCommand(string name, ExecuteCallback callback, Action configure) { var command = new AutocompleteCommandBuilder(this, name, callback); configure(command); @@ -403,7 +408,7 @@ namespace Discord.Interactions.Builders _modalCommands.Add(command); return this; } - + /// /// Adds a modal command builder to . ///