Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An AddSlashCommand overload should be AddAutocompleteCommand in ModuleBuilder #3014

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gehongyan
Copy link
Contributor

Description

In ModuleBuidler, an overload for adding autocomplete command was named AddSlashCommand instead of AddAutocompleteCommand. This pull request would like to correct the method name while maintaining backward compatibility.

/// <summary>
/// Adds autocomplete command builder to <see cref="AutocompleteCommands"/>.
/// </summary>
/// <param name="name">Name of the command.</param>
/// <param name="callback">Command callback to be executed.</param>
/// <param name="configure"><see cref="AutocompleteCommandBuilder"/> factory.</param>
/// <returns>
/// The builder instance.
/// </returns>
public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action<AutocompleteCommandBuilder> configure)
{
var command = new AutocompleteCommandBuilder(this, name, callback);
configure(command);
_autocompleteCommands.Add(command);
return this;
}

Changes

  • Renamed the method called AddSlashCommand to AddAutocompleteCommand to better reflect its functionality.
  • Introduced a new AddAutocompleteCommand method to supersede the original functionality.
  • Added an Obsolete attribute to the AddSlashCommand method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant