Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 75 additions & 7 deletions src/Discord.Net.Interactions/Builders/ModuleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ModuleBuilder WithDefaultPermision (bool permission)
}

/// <summary>
/// Adds attributes to <see cref="Attributes"/>
/// Adds attributes to <see cref="Attributes"/>.
/// </summary>
/// <param name="attributes">New attributes to be added to <see cref="Attributes"/>.</param>
/// <returns>
Expand All @@ -172,7 +172,7 @@ public ModuleBuilder AddAttributes (params Attribute[] attributes)
}

/// <summary>
/// Adds preconditions to <see cref="Preconditions"/>
/// Adds preconditions to <see cref="Preconditions"/>.
/// </summary>
/// <param name="preconditions">New preconditions to be added to <see cref="Preconditions"/>.</param>
/// <returns>
Expand All @@ -185,7 +185,7 @@ public ModuleBuilder AddPreconditions (params PreconditionAttribute[] preconditi
}

/// <summary>
/// Adds slash command builder to <see cref="SlashCommands"/>
/// Adds slash command builder to <see cref="SlashCommands"/>.
/// </summary>
/// <param name="configure"><see cref="SlashCommandBuilder"/> factory.</param>
/// <returns>
Expand All @@ -200,7 +200,24 @@ public ModuleBuilder AddSlashCommand (Action<SlashCommandBuilder> configure)
}

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

/// <summary>
/// Adds context command builder to <see cref="ContextCommands"/>.
/// </summary>
/// <param name="configure"><see cref="ContextCommandBuilder"/> factory.</param>
/// <returns>
Expand All @@ -215,7 +232,24 @@ public ModuleBuilder AddContextCommand (Action<ContextCommandBuilder> configure)
}

/// <summary>
/// Adds component command builder to <see cref="ComponentCommands"/>
/// Adds context command builder to <see cref="ContextCommands"/>.
/// </summary>
/// <param name="name">Name of the command.</param>
/// <param name="callback">Command callback to be executed.</param>
/// <param name="configure"><see cref="ContextCommandBuilder"/> factory.</param>
/// <returns>
/// The builder instance.
/// </returns>
public ModuleBuilder AddContextCommand(string name, ExecuteCallback callback, Action<ContextCommandBuilder> configure)
{
var command = new ContextCommandBuilder(this, name, callback);
configure(command);
_contextCommands.Add(command);
return this;
}

/// <summary>
/// Adds component command builder to <see cref="ComponentCommands"/>.
/// </summary>
/// <param name="configure"><see cref="ComponentCommandBuilder"/> factory.</param>
/// <returns>
Expand All @@ -230,7 +264,24 @@ public ModuleBuilder AddComponentCommand (Action<ComponentCommandBuilder> config
}

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

/// <summary>
/// Adds autocomplete command builder to <see cref="AutocompleteCommands"/>.
/// </summary>
/// <param name="configure"><see cref="AutocompleteCommands"/> factory.</param>
/// <returns>
Expand All @@ -245,7 +296,24 @@ public ModuleBuilder AddAutocompleteCommand(Action<AutocompleteCommandBuilder> c
}

/// <summary>
/// Adds sub-module builder to <see cref="SubModules"/>
/// 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;
}

/// <summary>
/// Adds sub-module builder to <see cref="SubModules"/>.
/// </summary>
/// <param name="configure"><see cref="ModuleBuilder"/> factory.</param>
/// <returns>
Expand Down